buzz 0.0.3 copy "buzz: ^0.0.3" to clipboard
buzz: ^0.0.3 copied to clipboard

An opinionated scalable framework for modern mobile apps

Buzz #

Opinionated modern event based application development framework.

Documentation #

Features #

  • UIEvents
  • Commands
    • Navigation
  • AppEvents

Upcoming #

  • Default navigator using Flutter Navigator 2.0.
  • Support adding custom TypedEventHandlers and EventBuses.

Installation #

buzz:
    git:
      url: git@github.com:LuisBurgos/buzz.git
      ref: main

Initialization #

Buzz..init(
  navigator: MyAppNavigator(),
);

Fire Events #

By default the framework supports firing three base class events:

  • UiEvent
  • Command
  • AppEvent

Find pre-defined out-of-the-box supported events.

UiEvents #

The library comes with a few pre-defined UiEvents you can find here.

For example, when a button/label is tapped:

ElevatedButton(
  onPressed: () {
    Buzz.fire(OnTapped());
  },
  child: Text('Tap me!'),
)

The library comes with a few pre-defined NavigationCommands you can find here.

Go to a route:

Buzz.fire(
  NavigateToCommand.named('/my-route'),
);

or go back to previous route:

Buzz.fire(NavigateBackCommand());

Listen Events #

Use the on method from the TypedEventBus component to get a Stream to listen events of a specific class type.

For example, here is how we setup the listener for NavigationCommands as part of the features ready for you to use, this happens behind the insides:

final commandBus = EventBusHolder.of<CommandEventBus>();
final navigationCommandStream = commandBus.on<NavigationCommand>();
navigationCommandStream.listen((navigationCommand) {
  NavigationCommandHandler(
    navigator: _navigator,
    backDefault: _navigator.backDefaultRoute,
  ).handle(navigationCommand);
});

Test Coverage #

brew install lcov
flutter test --coverage
genhtml coverage/lcov.info -o coverage/html
open coverage/html/index.html
0
likes
0
pub points
6%
popularity

Publisher

unverified uploader

An opinionated scalable framework for modern mobile apps

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

event_bus, flutter, rxdart

More

Packages that depend on buzz