Let us say that I have a stream (A) that could either get : SuccessModel or the FailureModel.
- I subscribe to this stream A using a StreamBuilder and well, I just want to route to the next page if this stream contains SuccessModel and stay at the same page if it contains the FailureModel.
- Now, since this is a StreamBuilder it always expects me to return a Widget but in this case I might want to just use Navigator to route to the next page.
Considering the above scenario, how should I go about it?
Should I just return an empty container and probably Future.delayed into the next page (upon success) or is there a method that I could use on my stream A so that I define a function or listener inside of my bloc class and it executes the right set of functions (routes) based upon the value that stream gets..
Any help would be appreciated!