registerOnClickListener static method

Future<bool> registerOnClickListener(
  1. Function callBackFunction
)

Register your callbackFunction to receive click events Your callback function should be declared as a global function (Outside the scope of the class) Don't forget to add @pragma('vm:entry-point') above your global function

Implementation

static Future<bool> registerOnClickListener(Function callBackFunction) async {
  final callBackDispatcher =
      PluginUtilities.getCallbackHandle(callbackDispatcher);
  final callBack = PluginUtilities.getCallbackHandle(callBackFunction);
  await _channel.invokeMethod("registerCallBackHandler",
      <dynamic>[callBackDispatcher!.toRawHandle(), callBack!.toRawHandle()]);
  return true;
}