event_bus_basics 1.0.0 event_bus_basics: ^1.0.0 copied to clipboard
A Dart package for logging events once and writing them to multiple services.
import 'package:event_bus_basics/event_bus_basics.dart';
Future<void> main() async {
final eventBus = EventBus();
eventBus.events.listen((event) {
print('event: $event');
});
eventBus.app(EventBusAppEvent.coldStart);
eventBus.tap('signin_button', screen: 'SignInScreen');
eventBus.network('SignInBloc: start signing');
eventBus.trace('SignInScreen.build: started', params: {'name': 'foobar'});
eventBus.event('sign_in', params: {'username': 'foobar'});
eventBus.error('SignInScreen._signIn: failed');
eventBus.send(EventBusGroup.trace, name: 'SignInScreen._signIn: completed');
}