๐Ÿ›ก๏ธ lifecycle_guard

The bulletproof Flutter plugin for mission-critical background execution.

Stop losing data when Android or iOS aggressively kills your app. lifecycle_guard ensures your background tasks survive termination, system reboots, and battery optimizations โ€” guaranteed.

GitHub pub version License: BSD-3 Flutter Platform


๐ŸŽฌ Demo

lifecycle_guard Demo

Watch lifecycle_guard in action: App swipe โ†’ Background survival โ†’ Task completion.


โœจ Features

Feature Description
๐Ÿ›ก๏ธ Isolate Protection Boots a lightweight secondary engine so your task never shares the UI thread fate
๐Ÿค– Android 15+ Ready Fully compliant with new foregroundServiceType: dataSync requirements
๐ŸŽ iOS Compatible Bridges to Apple's native background task scheduler
๐Ÿ“ก Zero Data Loss Tasks continue even when users swipe the app away
โšก 30-Second Setup One-line API โ€” no complex native configuration needed

๐Ÿš€ Quick Start

Installation

Add to your pubspec.yaml:

dependencies:
  lifecycle_guard: ^0.0.1

Usage

import 'package:lifecycle_guard/lifecycle_guard.dart';

// Trigger a mission-critical background task
await LifecycleGuard.runSecureTask(
  id: "sync_user_data",
  payload: {"userId": "12345"},
);

๐Ÿง  How It Works

lifecycle_guard uses a federated architecture to boot a native protected service (Android Foreground Service or iOS Background Task) that runs independently of your app's UI lifecycle.

Full technical details and architecture diagrams at GitHub.


๐Ÿ“„ License

BSD 3-Clause License โ€” see LICENSE for details.


Built with โค๏ธ by Crealify ยท Open to collaborate ยท PRs welcome

Libraries

lifecycle_guard