Open PlugFox opened 2 years ago
Also, you can change API for BLoC Observer to Interceptors list.
Something like that:
BlocObserver.instance..addAll(
<IBlocBaseInterceptor>[
CustomCubitInterceptor(),
CustomBlocInterceptor(),
CustomEventInterceptor(),
CustomTransationtInterceptor(),
CustomBlocErrorHandlerInterceptor(),
]
);
I think this is more handy and scale for every users)
Community can separate logic for:
Another idea:
you can simply add in Transition
class: bool get completed;
If completed
is true - this is last state for this event.
If this is implemented, I can uniformly handle the pop-up windows and pop-up window closing of network requests. Hope it can be realized soon. Thank you so much. The temporary compromise is to create a pop-up window in onevent and close the pop-up window in onTransition @felangel
Hi @felangel, any plans on this? Possibly you will accept a PR?
Add callback inside BLoC for BlocObserver:
or rename
onEvent
toonEventStarted
and addonEventFinished
onDone
event must be always called ifonEvent
called, no matter if an error occurred or not.This is the only proposal for the main idea of the wanted API.
Why do I want this feature? Because is very useful to know, how long events are executed and successful or not.
I want integrate it with analytics and Sentry transactions:
And get reports something like this:
Because BLoC's are always root for every business logic - this is very handy data. We can know, how often users doing some events/features, how long they are processing. Rate successful/error. What's error occurred inside BLoCs and events.