September 2019
Beginner
512 pages
12h 52m
English
So, now that we have checked the native implementation of the plugin, we need to understand how Flutter communicates with it from the Dart context. The generated Dart API file lib/hands_on_platform_version.dart is the entry point for consumer apps. The consumer packages will import this library to use the plugin. Let's check the API file:
// hands_on_platform_version.dartclass HandsOnPlatformVersion { static const MethodChannel _channel = const MethodChannel('hands_on_platform_version'); // 1 static Future<String> get platformVersion async { // 2 final String version = await _channel.invokeMethod('getPlatformVersion'); // 3 return version; }}
The HandsOnPlatformVersion class is public, as you can see, and it contains a single ...
Read now
Unlock full access