flutterlifecyclehooks library
Mixins
-
LifecycleMixin<
T extends StatefulWidget> - A mixin that can be used on StatefulWidgets. Implements WidgetsBindingObserver and handles de/registering by itself. Must implement onResume and onPause. Override onContextReady as alternative to initState to have context ready Also to synchronously obtain the lifecycle you can call currentLifecycleState