- BREAKING: feat: introduce
BlocOverrides
API (#2932)Bloc.observer
removed in favor ofBlocOverrides.runZoned
andBlocOverrides.current.blocObserver
Bloc.transformer
removed in favor ofBlocOverrides.runZoned
andBlocOverrides.current.eventTransformer
- BREAKING: refactor: make
BlocObserver
an abstract class - BREAKING: feat:
add
throwsStateError
when bloc is closed (#2912) - BREAKING: feat:
emit
throwsStateError
when bloc is closed (#2913) - BREAKING: feat: improve error handling/reporting
BlocUnhandledErrorException
is removed- Uncaught exceptions are always reported to
onError
and rethrown addError
reports error toonError
but does not propagate as an uncaught exception
- BREAKING: feat: restrict scope of
emit
inBloc
andCubit
- In
Cubit
,emit
isprotected
so it can only be used within theCubit
instance. - In
Bloc
,emit
isinternal
so 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
listen
onBlocBase
- feat: throw
StateError
if an event is added without a registered event handler