Apr 21, 2021
you just need to use BlocConsumer instead of BlocBuilder .. you'll find a listener methode : listener:(context,state){
// here you can just do
state.maybe(
state1:(){ navigate },
error :(){ showToast() },
....
)
}
because listener is only called once per state change .. don't navigate inside builder .. it's gonna show you many toasts message every time the build method is called