init method
Executed when a PatapataApp
run
s 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;
}