init method

  1. @override
FutureOr<bool> init(
  1. App<Object> app
)
override

Executed when a PatapataApp runs or when a this Plugin is added to the PatapataApp after run. This may return a Future for asynchronous initialization. Always call super.init before any other overridden code.

If any of the callbacks fail for any reason, the App will not continue to execute callbacks and will execute the onInitFailure callback if given. Otherwise, it will silently die. (Not do anything)

Implementation

@override
FutureOr<bool> init(App<Object> app) async {
  await super.init(app);

  _sub = app.analytics.events.listen((event) {
    if (event.name == 'wefwef') {
      // do something
    }
  });

  return true;
}