AppLifecycleListener class

AppLifecycle Listener

// import packages
import 'package:flutter/widgets.dart';
import 'package:flutter_waff/flutter_waff.dart';

// Start listener
AppLifecycleListener.startup(WidgetsFlutterBinding.ensureInitialized());
// or
AppLifecycleListener.startup(WidgetsBinding.instance!);

// Listen AppLifecycleState
var appLifecycleEventStream = eventBus.on<AppLifecycleEvent>().listen((event) {
  if (event.state == AppLifecycleState.resumed) {
    ...
  }
});
appLifecycleEventStream.cancel();

Constructors

AppLifecycleListener.startup(WidgetsBinding widgetsBindingInstance)
Start appLifecycle listen (single)
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
stop() → void
Stop listener
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited