The SwiftHandsOnBackgroundProcessPlugin class

The registration and setup of the plugin is done in a similar way to the HandsOnBackgroundProcessPlugin class. This time, in the register() static function, we have the following:

public static func register(with registrar: FlutterPluginRegistrar) {    let channel = FlutterMethodChannel(        name: "com.example.handson/plugin_channel",         binaryMessenger: registrar.messenger()    )    let instance = SwiftHandsOnBackgroundProcessPlugin(        registrar: registrar    )            registrar.addMethodCallDelegate(instance, channel: channel)}

Like in the Android version, it configures the method channel called com.example.handson/plugin_channel, which is used to initialize the calculation through the initBackgroundProcess method, as ...

Get Flutter for Beginners now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.