ServiceClient class
ServiceClient is the interface you can use to controll your foreground-service
note that you can only use ServiceClient in serviceMain
function you define in lib/main.dart
of
your application
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- channel ↔ MethodChannel
-
getter/setter pair
Static Methods
-
endExecution(
ServiceData data) → Future< void> -
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 ofAppClient.execute()
method that was called from application side. -
setExecutionCallback(
Future action(Map< String, dynamic> initialData)) → dynamic -
set the code you want to run
when foreground-service is ordered to start from application side using
AppClient.execute(serviceData)
you receive the ServiceData passed in that method asinitialData
in your callback -
stopService(
) → Future< String?> - stops service immediatly
-
update(
ServiceData data) → Future - updates shared ServiceData and which you can listen for on application side using AppClient.updates stream