You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using a Stream, we can add an error via its .addError(error) function. Then any StreamBuilder that is listening to it could get the error object via the AsyncSnapshot object.
That allows us to return a different widget to the builder function when any error occurs.
Is there something similar that we can do with MomentumBuilder?
I know we can send an event and just show a SnackBar instead. But in some cases we want to show an error widget to the screen itself.
Any thoughts?
Thanks!
The text was updated successfully, but these errors were encountered:
@jezer07
I created this library in mind that I don't need to use FutureBuilder and StreamBuilder. I want to handle everything from the controller and let MomentumBuilder display my state.
I think if you call .addError(error), the callback .onError(...) will react to it. So basically inside this callback, you can do anything like setting an error property in the model and display the error using MomentumBuilder.
When using a
Stream
, we can add an error via its.addError(error)
function. Then anyStreamBuilder
that is listening to it could get the error object via theAsyncSnapshot
object.That allows us to return a different widget to the
builder
function when any error occurs.Is there something similar that we can do with
MomentumBuilder
?I know we can send an event and just show a
SnackBar
instead. But in some cases we want to show an error widget to the screen itself.Any thoughts?
Thanks!
The text was updated successfully, but these errors were encountered: