extended_bloc 0.0.2-dev extended_bloc: ^0.0.2-dev copied to clipboard
A predictable state management library that helps implement the BLoC design pattern.
Extended BLoC #
EnumBloc<Event, State> #
BLoC with primitive events.
Override [router] and create generators.
Example usage:
class MyEnumBloc extends EnumBloc<Event, State> {
MyEnumBloc() : super(State.initial);
@override
Map<Event, Function> get router =>
<Event, Function>{
Event.read : _read,
};
Stream<MockState> _read() async* {
yield State.performing;
// ...
yield State.fetched;
}
}
RouterBloc<Event, State> #
BLoC with complex events, containing internal data.
Override [router] and create generators.
Example usage:
class MyRouterBloc extends RouterBloc<Event, State> {
MyRouterBloc() : super(InitialState());
@override
Map<Type, Function> get router =>
<Type, Function>{
PerformEvent : _perform,
};
Stream<State> _perform(PerformEvent event) async* {
yield PerformingState();
// ...
yield PerformedState();
}
}
Coverage #
Changelog #
Refer to the Changelog to get all release notes.
Features and bugs #
Please file feature requests and bugs at the issue tracker.