FLUTTER ECOSYSTEM

flutter_fgbg

Flutter plugin to detect when app(not Flutter container) goes to background or foreground

Latest version
0.8.0
30-day downloads
108K
Likes
182
Pub points
140

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

Overview

flutter_fgbg is a Flutter plugin that detects when the app (not just the Flutter container) transitions between foreground and background states on Android and iOS. It provides reliable callbacks for app lifecycle events such as entering the background or returning to the foreground, enabling developers to manage resources, pause timers, or save state appropriately. The plugin integrates seamlessly with native platform APIs to ensure accurate detection across different device conditions.

Use cases
  • Handling background tasks
  • Pausing media playback
  • Saving user state
  • Managing location updates
  • Optimizing battery usage
Key features
  • Cross-platform support (Android & iOS)
  • Native-level lifecycle detection
  • Simple event-based API
  • Lightweight and efficient
  • Real-time foreground/background state changes
Suitable for
  • Apps needing precise lifecycle awareness
  • Media or gaming apps
  • Location-sensitive applications
  • Battery-conscious apps
  • Background processing workflows
Considerations
  • Requires proper handling of background execution limits
  • May not trigger immediately on all device manufacturers
  • Limited to app-level state, not individual Flutter widgets
  • No support for web or desktop platforms
  • Depends on native OS behavior which can vary
Supported platformsAndroidiOS

Install package

flutter pub add flutter_fgbg

Categories

Source repository

Related projects