endExecution static method

Future<void> endExecution(
  1. ServiceData data
)

ends the execution of the foreground-service and return the data given to the application side as the result which will be received by application and passed as the return type of AppClient.execute() method that was called from application side.

in other words that AppClient.execute() starts the foreground-service and with ServiceClient.endExcution(serviceData) we can end the execution of foreground-service and also return a ServiceData object as a result to application side

Implementation

static Future<void> endExecution(ServiceData data) async {
  var dataWrapper = ServiceDataWrapper(data);
  return channel.invokeMethod(_END_EXECUTION, dataWrapper.toJson());
}