-
Hi there, I'm currently investigating flutter (in general) and I'm not a big fan of the BLoC pattern. Since I've been using xstate on web projects a lot, I searched for similar ways in flutter. One question with your lib arises: Can I unsubscribe from state updates in a widget? The general idea would be to subscribe in widged creation and unsubscribe on disposal (for example on routing). Regards |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
I am not familiar with BLoC or xstate; and this project is much older than Flutter, so there might be things missing in this context (feel free to report feature requests, if you spot something specific). That said, |
Beta Was this translation helpful? Give feedback.
-
Alright, thank you :-) I'm going to fiddle around with it! |
Beta Was this translation helpful? Give feedback.
I am not familiar with BLoC or xstate; and this project is much older than Flutter, so there might be things missing in this context (feel free to report feature requests, if you spot something specific).
That said,
StreamTransition
automatically unsubscribes from theStream
when the transition becomes inactive. This also happens when you stop the state machine, by callingstateMachine.stop()
.