Flutter Workmanager

Background task execution for Flutter apps

Execute Dart code in the background, even when your app is closed. Perfect for data sync, file uploads, and periodic maintenance tasks.

Key Features

  • Background Task Execution: Execute Dart code in the background on both Android and iOS platforms
  • Multiple Task Types: Support for one-off tasks, periodic tasks, and iOS processing tasks
  • Platform Constraints: Configure network, battery, charging, and other constraints for task execution
  • Debug Support: Built-in debugging with notifications to track background task execution

Supported Platforms

PlatformSupportNotes
Android FullAll WorkManager features supported
iOS FullBackground Fetch + BGTaskScheduler APIs
macOS🚧 PlannedFuture support through NSBackgroundActivityScheduler
Web Not supportedBackground execution not available
Windows/Linux Not supportedNo background task APIs

Common Use Cases

Use CaseDescription
Sync data from APIAutomatically fetch and sync data from your backend API
Upload files in backgroundUpload photos, documents when network conditions are optimal
Clean up old dataRemove old files, cache data, and maintain app performance
Fetch notificationsCheck for new notifications and messages from your server
Database maintenancePerform database cleanup and optimization tasks

Architecture

This plugin uses a federated architecture:

  • workmanager - Main package that provides the unified API
  • workmanager_android - Android implementation using WorkManager
  • workmanager_apple - iOS/macOS implementation using BGTaskScheduler
  • workmanager_platform_interface - Shared interface for platform implementations

All packages are automatically included when you add workmanager to pubspec.yaml.

Get Started

Ready to add background tasks to your Flutter app?

→ Quick Start Guide - Get up and running in minutes

→ API Documentation - Complete Dart API reference

Example Project

See a complete working demo: Example App →