built_valueis not required you're free to represent your State by other ways.
- It is Redux-based, not a attempt to be a Redux port.
- Unnecessary rebuilds are intolerable, that is why
whereis explicitly set by who knows about the State: you!
- Actions holds it's own reducers and can be Asynchronous through AsyncActions
- Middlewares can act before and after Actions, note that for
beforeActiontwice, one for before async execution and other for completed async execution, but before State rebuilding (#3)
- Connect is composable as any other Widget, not some class you should extend.
You can use Middlewares to inject dependencies on Actions. A good call is to use mixins so you can type-safely call setter injectors. That is how we make
FetchTodos action aware about
Differences to other implementations
It's a little layer above the StreamBuilder using RxDart, there's not much magic going on without your knowledge in Flutter vanilla. This is a biased comment since I am the author of this implementation, but I believe it is the most pragmatic way among the other solutions without any loss of performance or maintainability.
With a few lines of code you already have reactive components, all your State anytime you have a
BuildContext and full control over when they should be update avoiding any unnecessary rebuild.
There is no special treatment to test your Widgets, they are composed inside the
Connect like it would be on any
WidgetBuilder, but with it's sub-state instead of a
context, this sub-state can be freely mocked as simple plain-old Dart code.