ajinasokan / flutter_fgbg

Flutter plugin to detect when app(not Flutter container) goes to background or foreground
MIT License
81 stars 34 forks source link

Feature Request: Update FBBG to work on Web and Desktop #16

Closed csells closed 1 month ago

csells commented 1 month ago

I love that FBBG uses the Android and iOS-specific implementations on mobile. However, for me to use this on mobile and other things on desktop is pretty annoying. Would it be possible to update FBBG to use WidgetsBindingObserver and/or AppLifecycleListener on non-mobile so we can just have a single solution that works best on every platform?

csells commented 1 month ago

suggested fix: https://github.com/ajinasokan/flutter_fgbg/pull/17

ajinasokan commented 1 month ago

Makes sense. I had thought of this when I had to write an if-else for running app in macOS. But never really had the motivation to add this to plugin.

Sorry I couldn't check this sooner, I was a bit busy with the work. I will review the PR in a moment.

ajinasokan commented 1 month ago

This is published as flutter_fgbg: ^0.4.0.

Thank you for the PR.

csells commented 1 month ago

The plug-in still shows up on pub.dev as only supporting Android and iOS instead of all six Flutter platforms.