Building from your Firebase Login example, I am trying to include a reset password page that on failure returns you back to the login screen that then shows a snack bar saying "Reset Failed"
how do you pass state from one Bloc to another
Maybe you could use BlocListener to listen to the bloc state change in reset password page. If the state if failure for reset password, then you could navigate it back to the login page. In the navigation you could pop screen with argument Navigator.pop(context, 'Reset Failed');
Hi @kieronwiehahn 馃憢
Thanks for opening an issue!
You can handle bloc-to-bloc communication either by directly injecting blocA into blocB as described here or by using a BlocListener as @masfranzhuo mentioned to subscribe to blocA and notify blocB like:
BlocListener<BlocA, StateA>(
listener: (context, state) {
// notify `BlocB` in response to changes in `BlocA`
context.bloc<BlocB>().add(...);
},
child: ...
)
Hope that helps 馃憤
Thanks Guys. will give it a try 馃憤
Most helpful comment
Thanks Guys. will give it a try 馃憤