WorkmanagerExecution class

Shared registry that holds the currently registered background task handler.

One instance is shared by every execution context: the interactive app (where the dispatcher registers its handler) and the headless --background-task process (where the handler is invoked). Keeping the registry in a plain class means the headless runner never has to set up Flutter platform channels.

Properties

callbackDispatcher Function?
The callback dispatcher passed to WorkmanagerLinux().initialize(...) (or directly to WorkmanagerLinux.maybeRunBackgroundTask).
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
taskHandler BackgroundTaskHandler?
The handler registered by the most recent executeTask call.
getter/setter pair

Methods

executeTask(BackgroundTaskHandler handler) → void
Registers handler as the background task handler (mirrors Workmanager().executeTask(...)).
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
runTask(String taskName, Map<String, dynamic>? inputData) Future<bool>
Runs the registered handler with taskName and inputData.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

instance WorkmanagerExecution
The process-wide singleton.
final