Back to Flutter Boost

initInstances method

doc/api/boost_flutter_binding/BoostFlutterBinding/initInstances.html

5.0.2691 B
Original Source

initInstances method

  1. @override

voidinitInstances() override

The initialization method. Subclasses override this method to hook into the platform and otherwise configure their services. Subclasses must call "super.initInstances()".

By convention, if the service is to be provided as a singleton, it should be exposed as MixinClassName.instance, a static getter that returns MixinClassName._instance, a static field that is set by initInstances().

Implementation

@override
void initInstances() {
  super.initInstances();
  _instance = this;
  changeAppLifecycleState(AppLifecycleState.resumed);
}