September 2019
Beginner
512 pages
12h 52m
English
The first step is to set up the plugin, just like we already did in Chapter 9, Developing Your Own Flutter Plugin. It starts with an implementation of the static registerWith method that notifies the Flutter engine with the existence of the plugin instance:
class HandsOnBackgroundProcessPlugin( private val context: Context) : MethodChannel.MethodCallHandler{ companion object { ... @JvmStatic fun registerWith(registrar: PluginRegistry.Registrar) { val channel = MethodChannel( registrar.messenger(), "com.example.handson/plugin_channel" ) val plugin = HandsOnBackgroundProcessPlugin( registrar.context() ) channel.setMethodCallHandler(plugin) } } ...}
As you can see, it configures the method channel, ...
Read now
Unlock full access