init method
void
init({
- FeedbacksExecutor? feedbacksExecutor,
- bool withDebugDashboard = false,
- String? rootAppRoute,
- List<
BuzzRegistry> initialRegistries = const [],
Implementation
void init({
required Navigator navigator,
FeedbacksExecutor? feedbacksExecutor,
bool withDebugDashboard = false,
String? rootAppRoute,
List<BuzzRegistry> initialRegistries = const [],
}) {
this.navigator = navigator;
this.feedbacksExecutor = feedbacksExecutor;
Buzz.on().listen(
(event) => buzzLog('event fired: ${event.runtimeType}'),
);
registries.addAll(initialRegistries);
if (withDebugDashboard) {
if (rootAppRoute == null) {
throw ArgumentError(
'rootAppRoute cannot be null when withDebugDashboard is true',
);
}
registries.add(EventsDashboardBuzzRegistry(mainAppRoute: rootAppRoute));
}
registries.add(
NavigationBuzzRegistry(
navigator: navigator,
backDefault: navigator.backDefaultRoute,
),
);
if (feedbacksExecutor != null) {
registries.add(
FeedbacksExecutorBuzzRegistry(feedbacksExecutor: feedbacksExecutor),
);
}
for (var element in registries) {
buzzLog('register: $element');
element.register(this);
}
initDone = true;
}