flutter_android_lifecycle 1.0.0

Flutter Android iOS

Flutter plugin to get android lifecycle notifications from dart.

flutter_android_lifecycle #

A new Flutter plugin to enable flutter developer get android activity lifecycle notifications from dart.

Getting Started #

currently, this package supports three lifecycle notifications:

- OnStart
- OnResume
- OnPause

To use this package, all you have to do is

  • add flutter_android_lifecycle to your pubspec.yaml
  • change your MainActivity.java or MainActivity.kt to extend FlutterAndroidLifecycleActivity
  • Then you can start listening on notification lifecycle with these codes inside initState of your flutter application

for OnStart

    FlutterAndroidLifecycle.listenToOnStartStream().listen((_) {
          print("ONSTART CALLED");
        });

for OnResume

    FlutterAndroidLifecycle.listenToOnResumeStream().listen((_) {
          print("ONRESUME CALLED");
        });

for OnPause

    FlutterAndroidLifecycle.listenToOnPauseStream().listen((_) {
          print("ONPAUSE CALLED");
        });

Version #

  • 0.0.1
    • Initial Upload
  • 0.0.1+2
    • Add swift version on podspec
  • 0.0.1+3
    • Add override onNewIntent to set new intent on Activity
  • 0.0.1+4
    • Upgrade kotlin version to 1.3.21
  • 0.0.2
    • Added FragmentActivity support
  • 1.0.0
    • Added AndroidX support

Contributor #

  • Angga Dwi Arifandi (anggadwiarifandi96@gmail.com)
0
likes
80
pub points
72%
popularity

Flutter plugin to get android lifecycle notifications from dart.

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

anggadwiarifandi96@gmail.com

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on flutter_android_lifecycle