EdsonBueno / focus_detector

Android's onResume/onPause and iOS's viewDidAppear/viewDidDisappear for Flutter.
https://pub.dev/packages/focus_detector
MIT License
98 stars 54 forks source link

detect app in background, app closed, no internet. & custom triggers #5

Open jtkeyva opened 2 years ago

jtkeyva commented 2 years ago

if you double tap the home button on iphone, it minimizes current app and shows all apps tiled (app is not in foreground) but doesn't trigger a warning that the app in inactive/background.

is it possible to detect if the app is closed?

also, would be nice to add more detection triggers such as when there is no internet or if you're on cellular/wifi or even custom triggers

thanks

jtkeyva commented 2 years ago

Not sure if possible at the package level, but this detects more than focus. Perhaps you make a wrapper for MaterialApp? https://www.filledstacks.com/post/flutter-application-life-cycle-management/