flt_worker library

A unified and simplified API for scheduling general background tasks.

The background tasks scheduler is based on the BackgroundTasks framework on iOS 13+, and the WorkManager APIs on Android.

For more complex tasks, you may want to use the flatform-specific low-level work_manager and background_tasks APIs for Android and iOS devices respectively.

Classes

WorkConstraints
Constraints for a WorkIntent.
WorkIntent
Describes a work request.
WorkPayload
Payload of a background work.

Enums

NetworkType
An enumeration of various network types that can be used as WorkConstraints.

Functions

cancelAllWork() Future<bool>
Cancels all unfinished work.
cancelWork(String identifier) Future<bool>
Cancels all unfinished work with the given identifier.
enqueueWorkIntent(WorkIntent intent) Future<bool>
Enqueues a intent to work in the background.
initializeWorker(WorkerFn worker) Future<void>
Initializes the plugin by registering a worker callback.