register method

  1. @override
void register(
  1. BuzzBase buzz
)
override

Implementation

@override
void register(BuzzBase buzz) {
  Get.put<FireActionsInMemoryRepository>(FireActionsInMemoryRepository());

  buzz.on<UiEvent>().listen((event) {
    FireActionsInMemoryRepository.to.save(
      'ui',
      ConsoleEntry('$event'),
    );
  });

  buzz.on<Command>().listen((event) {
    FireActionsInMemoryRepository.to.save(
      'command',
      ConsoleEntry('$event'),
    );
  });

  buzz.on<AppEvent>().listen((event) {
    FireActionsInMemoryRepository.to.save(
      'app',
      ConsoleEntry('$event'),
    );
  });

  buzz.on<GoToDashboardPageUiEvent>().listen((event) {
    //TODO: Should we use buzz instead of Buzz here?
    Buzz.fire(NavigateToCommand.named(event.route ?? ''));
  });

  buzz.on<GoToAppTappedUiEvent>().listen((_) {
    Buzz.fire(NavigateToCommand.named(mainAppRoute));
  });
}