workmanager library

Classes

BackoffPolicyConfig
Constraints
ContentUriTrigger
A single content URI trigger for Android WorkManager constraints.
ContinuedProcessingTaskRequest
ForegroundServiceConfig
Android-only configuration that promotes a worker to a foreground service while it runs, keeping the process alive for long-running work.
HealthResearchTaskRequest
InitializeRequest
OneOffTaskRequest
PeriodicTaskRequest
ProcessingTaskRequest
WorkInfo
A snapshot of the current state of a background task, as observed by the plugin.
WorkInfoData
Snapshot of the current state of a background task, as served by the native platform. This is the transport type for WorkmanagerHostApi.getWorkInfoByUniqueName; the public, platform-agnostic model is WorkInfo.
Workmanager
Make sure you followed the platform setup steps first before trying to register any task.
WorkmanagerFlutterApi
WorkmanagerHostApi
WorkmanagerPlatform
The interface that implementations of workmanager must implement.

Enums

BackoffPolicy
An enumeration of backoff policies when retrying work. These policies are used when you have a return ListenableWorker.Result.retry() from a worker to determine the correct backoff time. Backoff policies are set in WorkRequest.Builder.setBackoffCriteria(BackoffPolicy, long, TimeUnit) or one of its variants.
ExistingPeriodicWorkPolicy
An enumeration of the conflict resolution policies when registering periodic work with the same unique name.
ExistingWorkPolicy
An enumeration of the conflict resolution policies when registering one-off work with the same unique name.
ForegroundServiceType
Foreground service types supported for Android long-running workers.
NetworkType
An enumeration of various network types that can be used as Constraints for work.
OutOfQuotaPolicy
An enumeration of policies that help determine out of quota behavior for expedited jobs.
StopReason
The reason a running background task was stopped by the platform before it finished.
TaskStatus
Task status for debugging and monitoring.
WorkState
The lifecycle state of a background task as observed by the plugin.

Functions

wrapResponse({Object? result, PlatformException? error, bool empty = false}) List<Object?>

Typedefs

BackgroundTaskHandler = Future<bool> Function(String taskName, Map<String, dynamic>? inputData)
Function that executes your background work. You should return whether the task ran successfully or not.
BackgroundTaskStoppedHandler = Future<void> Function(String taskName, StopReason stopReason)
Callback invoked when a running background task is stopped by the platform before it finished.
ProgressListener = void Function(String uniqueName, Map<String, dynamic> progress)
Signature for a listener that receives progress updates from running background tasks.