setServiceFunction static method

Future<void> setServiceFunction(
  1. Function serviceFunction
)

Set the function being executed periodically by the service

Implementation

static Future<void> setServiceFunction(Function serviceFunction) async {
  try {
    final serviceFunctionHandle =
        PluginUtilities.getCallbackHandle(serviceFunction)?.toRawHandle();

    await _invokeMainChannel(
        "setServiceFunctionHandle", <dynamic>[serviceFunctionHandle]);
  } catch (error) {
    debugPrint(error.toString());
  }
}