bloc
v8.1.4A predictable state management library that helps implement the BLoC (Business Logic Component) design pattern.
Package archive: https://pubdev.letsnova.ru/api/archives/bloc/8.1.4.tar.gz
dart pub add blocReadme
A dart package that helps implement the BLoC pattern.
Learn more at bloclibrary.dev!
This package is built to work with:
Sponsors
Our top sponsors are shown below! [Become a Sponsor]
|
|
|
|
|
|
Overview
The goal of this package is to make it easy to implement the BLoC Design Pattern (Business Logic Component).
This design pattern helps to separate presentation from business logic. Following the BLoC pattern facilitates testability and reusability. This package abstracts reactive aspects of the pattern allowing developers to focus on writing the business logic.
Cubit

A Cubit is class which extends BlocBase and can be extended to manage any type of state. Cubit requires an initial state which will be the state before emit has been called. The current state of a cubit can be accessed via the state getter and the state of the cubit can be updated by calling emit with a new state.

State changes in cubit begin with predefined function calls which can use the emit method to output new states. onChange is called right before a state change occurs and contains the current and next state.
Creating a Cubit
/// A `CounterCubit` which manages an `int` as its state.
class CounterCubit extends Cubit<int> {
/// The initial state of the `CounterCubit` is 0.
CounterCubit() : super(0);
/// When increment is called, the current state
/// of the cubit is accessed via `state` and
/// a new `state` is emitted via `emit`.
void increment() => emit(state + 1);
}
Using a Cubit
void main() {
/// Create a `CounterCubit` instance.
final cubit = CounterCubit();
/// Access the state of the `cubit` via `state`.
print(cubit.state); // 0
/// Interact with the `cubit` to trigger `state` changes.
cubit.increment();
/// Access the new `state`.
print(cubit.state); // 1
/// Close the `cubit` when it is no longer needed.
cubit.close();
}
Observing a Cubit
onChange can be overridden to observe state changes for a single cubit.
onError can be overridden to observe errors for a single cubit.
class CounterCubit extends Cubit<int> {
CounterCubit() : super(0);
void increment() => emit(state + 1);
@override
void onChange(Change<int> change) {
super.onChange(change);
print(change);
}
@override
void onError(Object error, StackTrace stackTrace) {
print('$error, $stackTrace');
super.onError(error, stackTrace);
}
}
BlocObserver can be used to observe all cubits.
class MyBlocObserver extends BlocObserver {
@override
void onCreate(BlocBase bloc) {
super.onCreate(bloc);
print('onCreate -- ${bloc.runtimeType}');
}
@override
void onChange(BlocBase bloc, Change change) {
super.onChange(bloc, change);
print('onChange -- ${bloc.runtimeType}, $change');
}
@override
void onError(BlocBase bloc, Object error, StackTrace stackTrace) {
print('onError -- ${bloc.runtimeType}, $error');
super.onError(bloc, error, stackTrace);
}
@override
void onClose(BlocBase bloc) {
super.onClose(bloc);
print('onClose -- ${bloc.runtimeType}');
}
}
void main() {
Bloc.observer = MyBlocObserver();
// Use cubits...
}
Bloc

A Bloc is a more advanced class which relies on events to trigger state changes rather than functions. Bloc also extends BlocBase which means it has a similar public API as Cubit. However, rather than calling a function on a Bloc and directly emitting a new state, Blocs receive events and convert the incoming events into outgoing states.

State changes in bloc begin when events are added which triggers onEvent. The events are then funnelled through an EventTransformer. By default, each event is processed concurrently but a custom EventTransformer can be provided to manipulate the incoming event stream. All registered EventHandlers for that event type are then invoked with the incoming event. Each EventHandler is responsible for emitting zero or more states in response to the event. Lastly, onTransition is called just before the state is updated and contains the current state, event, and next state.
Creating a Bloc
/// The events which `CounterBloc` will react to.
sealed class CounterEvent {}
/// Notifies bloc to increment state.
final class CounterIncrementPressed extends CounterEvent {}
/// A `CounterBloc` which handles converting `CounterEvent`s into `int`s.
class CounterBloc extends Bloc<CounterEvent, int> {
/// The initial state of the `CounterBloc` is 0.
CounterBloc() : super(0) {
/// When a `CounterIncrementPressed` event is added,
/// the current `state` of the bloc is accessed via the `state` property
/// and a new state is emitted via `emit`.
on<CounterIncrementPressed>((event, emit) => emit(state + 1));
}
}
Using a Bloc
Future<void> main() async {
/// Create a `CounterBloc` instance.
final bloc = CounterBloc();
/// Access the state of the `bloc` via `state`.
print(bloc.state); // 0
/// Interact with the `bloc` to trigger `state` changes.
bloc.add(CounterIncrementPressed());
/// Wait for next iteration of the event-loop
/// to ensure event has been processed.
await Future.delayed(Duration.zero);
/// Access the new `state`.
print(bloc.state); // 1
/// Close the `bloc` when it is no longer needed.
await bloc.close();
}
Observing a Bloc
Since all Blocs extend BlocBase just like Cubit, onChange and onError can be overridden in a Bloc as well.
In addition, Blocs can also override onEvent and onTransition.
onEvent is called any time a new event is added to the Bloc.
onTransition is similar to onChange, however, it contains the event which triggered the state change in addition to the currentState and nextState.
sealed class CounterEvent {}
final class CounterIncrementPressed extends CounterEvent {}
class CounterBloc extends Bloc<CounterEvent, int> {
CounterBloc() : super(0) {
on<CounterIncrementPressed>((event, emit) => emit(state + 1));
}
@override
void onEvent(CounterEvent event) {
super.onEvent(event);
print(event);
}
@override
void onChange(Change<int> change) {
super.onChange(change);
print(change);
}
@override
void onTransition(Transition<CounterEvent, int> transition) {
super.onTransition(transition);
print(transition);
}
@override
void onError(Object error, StackTrace stackTrace) {
print('$error, $stackTrace');
super.onError(error, stackTrace);
}
}
BlocObserver can be used to observe all blocs as well.
class MyBlocObserver extends BlocObserver {
@override
void onCreate(BlocBase bloc) {
super.onCreate(bloc);
print('onCreate -- ${bloc.runtimeType}');
}
@override
void onEvent(Bloc bloc, Object? event) {
super.onEvent(bloc, event);
print('onEvent -- ${bloc.runtimeType}, $event');
}
@override
void onChange(BlocBase bloc, Change change) {
super.onChange(bloc, change);
print('onChange -- ${bloc.runtimeType}, $change');
}
@override
void onTransition(Bloc bloc, Transition transition) {
super.onTransition(bloc, transition);
print('onTransition -- ${bloc.runtimeType}, $transition');
}
@override
void onError(BlocBase bloc, Object error, StackTrace stackTrace) {
print('onError -- ${bloc.runtimeType}, $error');
super.onError(bloc, error, stackTrace);
}
@override
void onClose(BlocBase bloc) {
super.onClose(bloc);
print('onClose -- ${bloc.runtimeType}');
}
}
void main() {
Bloc.observer = MyBlocObserver();
// Use blocs...
}
Dart Versions
- Dart 2: >= 2.12
Examples
- Counter - an example of how to create a
CounterBlocin a pure Dart app.
Maintainers
Changelog
8.1.4
- docs: improve diagrams
- chore: update copyright year
- chore: update sponsors
8.1.3
- chore: update sponsors (#4054)
- chore: fix
require_trailing_commas(#3977) - chore(deps): upgrade to
package:mocktail v1.0.0(#3919) - chore: add
topicstopubspec.yaml(#3914)
8.1.2
- docs: upgrade README snippets to Dart 3 (#3826)
- refactor: standardize analysis options and resolve warnings (#3826)
- docs: remove superfluous word from inline docs (#3734)
8.1.1
- chore: add screenshots to
pubspec.yaml(#3708) - refactor:
constconstructor support forBlocObserver(#3704) - refactor: upgrade to Dart 2.19 (#3699)
- remove deprecated
invariant_booleanslint rule
- remove deprecated
8.1.0
- feat: reintroduce
Bloc.observerandBloc.transformer(#3469)- deprecate:
BlocOverrides
- deprecate:
- fix: remove unnecessary
asyncfromEmitter.onEach(#3392) - chore: upgrade to
mocktail ^0.3.0(#3477)
8.0.3
- refactor: resolve analysis warnings (#3189)
- docs: fix inline doc comment (#3167)
- docs: update GetStream utm tags (#3136)
- docs: update VGV sponsors logo (#3125)
8.0.2
- fix: make
onChangeandaddErrorprotected (#3071) - refactor: use
latekeyword for internal state controller (#3100) - refactor: add
isClosedtoClosable(#3066) - refactor: add core interfaces (#3012)
- refactor: internal reorganization (#3011)
- docs: update example to follow naming conventions (#3029)
8.0.1
- fix: allow
emitusage within tests (#2982)
8.0.0
- BREAKING: feat: introduce
BlocOverridesAPI (#2932)Bloc.observerremoved in favor ofBlocOverrides.runZonedandBlocOverrides.current.blocObserverBloc.transformerremoved in favor ofBlocOverrides.runZonedandBlocOverrides.current.eventTransformer
- BREAKING: refactor: make
BlocObserveran abstract class - BREAKING: feat:
addthrowsStateErrorwhen bloc is closed (#2912) - BREAKING: feat:
emitthrowsStateErrorwhen bloc is closed (#2913) - BREAKING: feat: improve error handling/reporting
BlocUnhandledErrorExceptionis removed- Uncaught exceptions are always reported to
onErrorand rethrown addErrorreports error toonErrorbut does not propagate as an uncaught exception
- BREAKING: feat: restrict scope of
emitinBlocandCubit- In
Cubit,emitisprotectedso it can only be used within theCubitinstance. - In
Bloc,emitisinternalso it cannot be used outside of the internal package implementation.
- In
- BREAKING: refactor: remove deprecated
TransitionFunction - BREAKING: refactor: remove deprecated
transformEvents - BREAKING: refactor: remove deprecated
mapEventToState - BREAKING: refactor: remove deprecated
transformTransitions - BREAKING: refactor: remove deprecated
listenonBlocBase - feat: throw
StateErrorif an event is added without a registered event handler
8.0.0-dev.5
- BREAKING: feat: introduce
BlocOverridesAPI (#2932)Bloc.observerremoved in favor ofBlocOverrides.runZonedandBlocOverrides.current.blocObserverBloc.transformerremoved in favor ofBlocOverrides.runZonedandBlocOverrides.current.eventTransformer
- BREAKING: refactor: make
BlocObserveran abstract class - BREAKING: feat:
addthrowsStateErrorwhen bloc is closed (#2912) - BREAKING: feat:
emitthrowsStateErrorwhen bloc is closed (#2913)
8.0.0-dev.4
- BREAKING: feat: improve error handling/reporting
BlocUnhandledErrorExceptionis removed- Uncaught exceptions are always reported to
onErrorand rethrown addErrorreports error toonErrorbut does not propagate as an uncaught exception
8.0.0-dev.3
- BREAKING: feat: restrict scope of
emitinBlocandCubit- In
Cubit,emitisprotectedso it can only be used within theCubitinstance. - In
Bloc,emitisinternalso it cannot be used outside of the internal package implementation.
- In
8.0.0-dev.2
- BREAKING: refactor: remove deprecated
listenonBlocBase
8.0.0-dev.1
- BREAKING: refactor: remove deprecated
TransitionFunction - BREAKING: refactor: remove deprecated
transformEvents - BREAKING: refactor: remove deprecated
mapEventToState - BREAKING: refactor: remove deprecated
transformTransitions - feat: throw
StateErrorif an event is added without a registered event handler
7.2.1
- fix:
on<E extends Event>should have anEventTransformer<E>instead ofEventTransformer<Event>
7.2.0
- feat: introduce
on<Event>API to register event handlers- by default events are processed concurrently
- feat: introduce
Bloc.transformerAPI to configure the defaultEventTransformer - feat: introduce
Emitter<State>to trigger state changescallto trigger a state change (alignment withCubit)forEachas an analogue forawait foronEachto simplify subscription managementisDoneto abort expensive async operations
- feat: throw
StateErrorifmapEventToStateis used in conjunction withon<Event> - feat: throw
StateErrorif duplicate event handlers are registered - feat: throw
AssertionErrorwhenemitis called in a completedEventHandler - feat: throw
AssertionErrorwhenemit.onEachandemit.forEachare unawaited - DEPRECATE: fix:
mapEventToStatedeprecated in favor ofon<Event> - DEPRECATE: fix:
transformEventsdeprecated in favor ofEventTransformer- use a built in
EventTransformeror define your own
- use a built in
- DEPRECATE: fix:
transformTransitionsdeprecated- override
Stream<State> get streamto modify the outbound stream
- override
7.2.0-dev.3
- BREAKING: refactor: require
emit.forEachonDatato be synchronous - refactor: minor internal optimizations in
on<Event>implementation
7.2.0-dev.2
- BREAKING: refactor!: make
onDatacallback inemit.onEachandemit.forEachnamed - BREAKING: feat!: rename
emit.isCanceledtoemit.isDoneto encapsulate completion and cancelation - feat: introduce optional
onErrorinemit.onEachandemit.forEach - feat: throw
AssertionErrorwhenemitis called in a completedEventHandler - feat: throw
AssertionErrorwhenemit.onEachandemit.forEachare unawaited - fix:
emit.onEachandemit.forEacherror propagation when stream emits an error
7.2.0-dev.1
- feat: introduce
on<Event>API to register event handlers- by default events are processed concurrently
- feat: introduce
Bloc.transformerAPI to configure the defaultEventTransformer - feat: introduce
Emitter<State>to trigger state changescallto trigger a state change (alignment withCubit)forEachas an analogue forawait foronEachto simplify subscription managementisCanceledto abort expensive async operations
- feat: throw
StateErrorifmapEventToStateis used in conjunction withon<Event> - feat: throw
StateErrorif duplicate event handlers are registered - DEPRECATE: fix:
mapEventToStatedeprecated in favor ofon<Event> - DEPRECATE: fix:
transformEventsdeprecated in favor ofEventTransformer- use a built in
EventTransformeror define your own
- use a built in
- DEPRECATE: fix:
transformTransitionsdeprecated- override
Stream<State> get streamto modify the outbound stream
- override
7.1.0
- feat: expose
isClosedgetter onBlocBase - refactor: simplify internal event controller initialization
- docs: update
onChangedescription in README - docs: update GetStream sponsorship urls
7.0.0
- BREAKING: refactor:
BlocandCubitextendBlocBase- refactor:
void onError(Cubit cubit, Object error, StackTrace stackTrace)->void onError(BlocBase bloc, Object error, StackTrace stackTrace) - refactor:
void onCreate(Cubit cubit)->void onCreate(BlocBase bloc) - refactor:
void onClose(Cubit cubit)->void onClose(BlocBase bloc)
- refactor:
- BREAKING: refactor:
BlocandCubitdo not extendStreamand implementSink- refactor: use
bloc.streamorcubit.streamto accessStream<State>myBloc.map(...)->myBloc.stream.map(...)
- refactor: deprecate
bloc.listenin favor ofbloc.stream.listen
- refactor: use
- BREAKING: refactor:
CubitUnhandledErrorException->BlocUnhandledErrorException - BREAKING: opt into null safety
- feat!: upgrade Dart SDK constraints to
>=2.12.0-0 <3.0.0
- feat!: upgrade Dart SDK constraints to
- fix:
transformEventsmultiple subscriptions issue - test: improve testing for advanced
transformEventsbehavior - chore: bump to
meta: ^1.3.0
7.0.0-nullsafety.4
- BREAKING: refactor:
BlocandCubitextendBlocBase- refactor:
void onError(Bloc bloc, Object error, StackTrace stackTrace)->void onError(BlocBase bloc, Object error, StackTrace stackTrace) - refactor:
void onCreate(Bloc bloc)->void onCreate(BlocBase bloc) - refactor:
void onClose(Bloc bloc)->void onClose(BlocBase bloc)
- refactor:
- BREAKING: refactor:
BlocandCubitdo not extendStreamand implementSink- refactor: use
bloc.streamorcubit.streamto accessStream<State>myBloc.map(...)->myBloc.stream.map(...)
- refactor: deprecate
bloc.listenin favor ofbloc.stream.listen
- refactor: use
- BREAKING: revert: refactor:
ChangeandonChangeremoved in favor ofTransitionandonTransition
7.0.0-nullsafety.3
- fix:
transformEventsmultiple subscriptions issue - test: improve testing for advanced
transformEventsbehavior
7.0.0-nullsafety.2
- chore: bump to
meta: ^1.3.0
7.0.0-nullsafety.1
- BREAKING: refactor:
CubitextendsBloc- refactor:
ChangeandonChangeremoved in favor ofTransitionandonTransition - refactor:
void onError(Cubit cubit, Object error, StackTrace stackTrace)->void onError(Bloc bloc, Object error, StackTrace stackTrace) - refactor:
void onCreate(Cubit cubit)->void onCreate(Bloc bloc) - refactor:
void onClose(Cubit cubit)->void onClose(Bloc bloc) - refactor:
CubitUnhandledErrorException->BlocUnhandledErrorException
- refactor:
7.0.0-nullsafety.0
- BREAKING: opt into null safety
- feat!: upgrade Dart SDK constraints to
>=2.12.0-0 <3.0.0
6.1.3
- fix:
transformEventsmultiple subscriptions issue due tov6.1.2
6.1.2
- fix: bloc memory leak due to internal event stream being a broadcast stream
6.1.1
- fix:
closeshould always emit done
6.1.0
- feat: add
onCreateandonClosetoBlocObserver
6.0.3
- docs: README updates to include flow diagrams for
BlocandCubit.
6.0.2
- refactor: cubit internal memory and performance optimizations
6.0.1
- docs: minor documentation fixes and improvements
6.0.0
- BREAKING: do not emit current state on subscription
- BREAKING:
onErrorinBlocObservertakes aCubitas first parameter - BREAKING: allow blocs and cubits to emit the initial state
- feat: include
cubitand remove external dependency on package:cubit- exports class
Cubit - exports class
Change(TransitionforCubit)
- exports class
- feat:
onChangeadded toBlocObserver - refactor: apply additional lint rules
- fix: add
@visibleForTestingtoemiton classCubit - docs: fix inline documentation references
6.0.0-dev.2
- fix: add
@visibleForTestingtoemiton classCubit
6.0.0-dev.1
- BREAKING: do not emit current state on subscription
- BREAKING:
onErrorinBlocObservertakes aCubitas first parameter - BREAKING: allow blocs and cubits to emit the initial state
- feat: include
cubitand remove external dependency on package:cubit- exports class
Cubit - exports class
Change(TransitionforCubit)
- exports class
- feat:
onChangeadded toBlocObserver - refactor: apply additional lint rules
- docs: fix inline documentation references
5.0.1
- fix: upgrade to
cubit ^0.1.2 - docs: minor documentation updates
5.0.0
- BREAKING: remove
initialStateoverride in favor of providing the initial state via super (#1304). - BREAKING: Remove
BlocSupervisorand renameBlocDelegatetoBlocObserver. - feat: support
nullstates (#1312). - refactor: bloc to extend cubit rather than
Stream. - feat: ignore newly added events after bloc is closed (#1236).
- feat: add
addErrorto conform toEventSinkinterface. - feat: mark
onError,onTransition,onEventasprotected. - docs: documentation improvements
- docs: logo updates
5.0.0-dev.11
- feat: add
addErrorto conform toEventSinkinterface. - feat: mark
onError,onTransition,onEventasprotected.
5.0.0-dev.10
- docs: additional minor improvement to bloc logo alignment
5.0.0-dev.9
- docs: minor improvement to bloc logo alignment
5.0.0-dev.8
- BREAKING: Remove
BlocSupervisorand renameBlocDelegatetoBlocObserver.
5.0.0-dev.7
- Ignore newly added events after bloc is closed (#1236).
5.0.0-dev.6
- Additional documentation optimizations.
5.0.0-dev.5
- Optimize documentation assets for smaller viewports.
5.0.0-dev.4
- Update to cubit
^0.0.13 - Update documentation and static assets.
5.0.0-dev.3
- Update documentation and static assets.
5.0.0-dev.2
- BREAKING: update
initialStateto be a required positional parameter (related issue).
5.0.0-dev.1
- BREAKING: remove
initialStateoverride in favor of providing the initial state via super (#1304). - feat: support
nullstates (#1312). - refactor: bloc to extend cubit rather than
Stream.
4.0.0
- Remove
rxdartdependency (#821) - Replace
transformStateswithtransformTransitions(#840) - Fix null
stackTraceinonError(#963) - Fix remove duplicate terminating state
- Add
mustCallSupertoonEvent,onTransition, andonError - Surface Unhandled Bloc Errors in Debug Mode
- Internal testing improvements
4.0.0-dev.4
- Surface Unhandled Bloc Errors in Debug Mode
- Internal testing improvements
4.0.0-dev.3
- Add
mustCallSupertoonEvent,onTransition, andonError
4.0.0-dev.2
- Fix remove duplicate terminating state
4.0.0-dev.1
- Remove
rxdartdependency (#821) - Replace
transformStateswithtransformTransitions(#840) - Fix null
stackTraceinonError(#963)
3.0.0
- Upgrade to
rxdart ^0.23.0 - Upgrade to
Dart >= 2.6.0
3.0.0-dev.1
- Upgrade to
rxdart ^0.23.0
2.0.0
- Allow blocs to finish processing pending events on
close(#639) - Documentation Updates
1.0.1
- Bugfix: Exceptions thrown in
onTransitionare passed toonErrorand should not break bloc functionality (#641) - Adhere to effective dart (#561)
- Documentation and Example Updates
1.0.0
dispatchanddisposeremoved- Documentation Updates
0.16.1
- Minor Documentation Updates
0.16.0
- Bloc extends
Stream<State>(#558)bloc.state.listen->bloc.listenbloc.currentState->bloc.state
- Bloc implements
Sink<Event>(#558)dispatchdeprecated in favor ofadddisposedeprecated in favor ofclose
- Documentation and Example Updates
0.15.0
0.14.4
Additional Dependency and Documentation Updates.
0.14.3
Dependency and Documentation Updates.
0.14.2
- Deprecated Bloc
eventStream (#326) - Documentation Updates
0.14.1
Internal BlocDelegate update and Documentation Updates.
0.14.0
BlocDelegate initialization improvements and Documentation Updates.
BlocSupervisor().delegate = ...is nowBlocSupervisor.delegate = ...(#304).
0.13.0
Bloc and BlocDelegate Improvements, new Features, and Documentation Updates.
- Improved
disposeto ignore pending events (#257). - Exposed
eventstream onBlocsimilar tostatestream to expose aStreamofdispatchedevents (#259). - Update to use
rxdartversion^0.22.0(#265). BlocDelegatemethods include a reference to theBlocinstance (#259).- Added
onEventtoBlocandBlocDelegate(#259).
0.12.0
Updated transform to enable advanced event filtering and processing and Documentation Updates.
0.11.2
Added BlocDelegate onError and onTransition mustCallSuper and Documentation Updates
0.11.1
Added dispose mustCallSuper and Documentation Updates
0.11.0
Update mapEventToState to remove unnecessary argument for currentState
Stream<S> mapEventToState(S currentState, E event)->Stream<S> mapEventToState(E event)- Documentation Updates
- Example Updates
0.10.0
Updated to rxdart ^0.21.0 and Documentation Updates
0.9.5
Minor Enhancements to Code Style and Documentation.
0.9.4
Calls to dispatch after dispose has been called trigger onError in the Bloc and BlocDelegate.
0.9.3
Restrict rxdart to ">=0.18.1 <0.21.0" due to breaking changes.
0.9.2
Additional Minor Updates to Documentation
0.9.1
Minor Updates to Documentation
0.9.0
Bloc and BlocDelegate Error Handling
- Added
onErrortoBlocfor local error handling. - Added
onErrortoBlocDelegatefor global error handling.
0.8.4
Blocs handle exceptions thrown in mapEventToState and documentation updates.
0.8.3
Minor Internal Improvements and Documentation Updates
0.8.2
Additional Minor Updates to Documentation
0.8.1
Minor Updates to Documentation
0.8.0
Blocs ignore duplicate states
0.7.8
Additional Minor Updates to Documentation
0.7.7
Additional Minor Updates to Documentation
0.7.6
Minor Updates to Documentation
0.7.5
Exposed currentState in Bloc
- Updates to Documentation.
0.7.4
Updated mapEventToState parameter name
Stream<S> mapEventToState(S state, E event)->Stream<S> mapEventToState(S currentState, E event)- Updates to Documentation.
- Updates to Example.
0.7.3
Minor Updates to Documentation
0.7.2
Transition Fix
BlocwithmapEventToStatewhich returns multiple states per event will now correctly report theTransitions.
0.7.1
Improvements to Bloc usage in pure Dart applications.
Blocstate is seeded withinitialStateautomatically
0.7.0
Added BlocSupervisor and BlocDelegate.
BlocSupervisornotifiesBlocDelegateofTransitionsBlocDelegateexposesonTransitionwhich is invoked for allBlocTransitions.
0.6.0
Transitions and initialState updates.
- Added
Transitions andonTransition - Made
initialStaterequired
0.5.2
Additional minor Updates to Documentation.
0.5.1
Minor Updates to Documentation
0.5.0
Moved Flutter Widgets to flutter_bloc package
0.4.2
Additional minor Updates to Documentation.
0.4.1
Minor Updates to Documentation.
0.4.0
Added BlocProvider.
BlocProvider.of(context)- Updates to Documentation.
- Updates to Example.
0.3.0
Updated mapEventToState to take current state as an argument.
Stream<S> mapEventToState(E event)->Stream<S> mapEventToState(S state, E event)- Updates to Documentation.
- Updates to Example.
0.2.5
Additional Minor Updates to Documentation.
0.2.4
Additional Minor Updates to Documentation.
0.2.3
Additional Minor Updates to Documentation.
0.2.2
Additional Minor Updates to Documentation.
0.2.1
Minor Updates to Documentation.
0.2.0
Added Support for Stream Transformation
- Includes
Stream<E> transform(Stream<E> events) - Updates to Documentation
0.1.2
Additional Minor Updates to Documentation.
0.1.1
Minor Updates to Documentation.
0.1.0
Initial Version of the library.
- Includes the ability to create a custom Bloc by extending
Blocclass. - Includes the ability to connect presentation layer to
Blocby using theBlocBuilderWidget.







