WorkmanagerAndroid class

Android implementation of WorkmanagerPlatform.

Inheritance
  • Object
  • PlatformInterface
  • WorkmanagerAndroid

Constructors

WorkmanagerAndroid()
Constructs an AndroidWorkmanager.

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

cancelAll() Future<void>
Cancel all registered tasks.
cancelByTag(String tag) Future<void>
Cancel a task by its tag.
cancelByUniqueName(String uniqueName) Future<void>
Cancel a task by its unique name.
getWorkInfo(String uniqueName) Future<WorkInfo?>
Queries the current state of the task registered under uniqueName.
initialize(Function callbackDispatcher, {bool isInDebugMode = false}) Future<void>
Initialize the platform workmanager with the callback function.
isScheduledByUniqueName(String uniqueName) Future<bool>
Check if a task is scheduled by its unique name (Android only).
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
printScheduledTasks() Future<String>
Print scheduled tasks for debugging (iOS only).
registerContinuedProcessingTask(String uniqueName, String taskName, {String? title, String? subtitle, Map<String, dynamic>? inputData}) Future<void>
Register a continued processing task (iOS 26+ only).
registerHealthResearchTask(String uniqueName, String taskName, {Duration? initialDelay, Map<String, dynamic>? inputData, Constraints? constraints}) Future<void>
Register a health research task (iOS 17+ only).
registerOneOffTask(String uniqueName, String taskName, {Map<String, dynamic>? inputData, Duration? initialDelay, Constraints? constraints, ExistingWorkPolicy? existingWorkPolicy, BackoffPolicy? backoffPolicy, Duration? backoffPolicyDelay, String? tag, OutOfQuotaPolicy? outOfQuotaPolicy, ForegroundServiceConfig? foregroundServiceConfig, bool expedited = false}) Future<void>
Register a one-off task that will be executed once in the background.
registerPeriodicTask(String uniqueName, String taskName, {Duration? frequency, Duration? flexInterval, Map<String, dynamic>? inputData, Duration? initialDelay, Constraints? constraints, ExistingPeriodicWorkPolicy? existingWorkPolicy, BackoffPolicy? backoffPolicy, Duration? backoffPolicyDelay, String? tag, ForegroundServiceConfig? foregroundServiceConfig}) Future<void>
Register a periodic task that will be executed repeatedly in the background.
registerProcessingTask(String uniqueName, String taskName, {Duration? initialDelay, Map<String, dynamic>? inputData, Constraints? constraints}) Future<void>
Register a processing task (iOS only).
reportProgress(Map<String, dynamic> progress) Future<void>
Reports progress for the currently running task (Android only).
setProgressListener(ProgressListener? listener) Future<void>
Registers a listener that receives progress updates from running background tasks (Android only).
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

registerWith() → void
Registers this class as the default instance of WorkmanagerPlatform.