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.
Note: Redurx isn't a Redux implementation! It borrows some naming conventions, but you'll see a very distinct approach to Actions and Middlewares. For a Redux port on Dart, please visit: flutter_redux.
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.
Differences to Redux
These two libraries are very similar since they're both based on ReduxJS. These are the differences:
redurx- Actions describe how the state should change
Redux- Actions are plain ol' Dart values, Classes or Enums. Could optionally create an Action type that describes how the state should change.
redurx- No reducers! Handled inside the actions.
redux- A function that takes in the current app state and the latest action and return a new app state.
- Async code / side effects
Middlewareto perform async work / side-effects
redux_thunk(very similar to
- Slight API differences
- Both allow you to listen for specific actions and perform work based on those actions
- Flutter integration
- Convert the latest state of the Store into a Widget
- Allow you to filter which state changes result in a Widget rebuild
flutter_redux- currently offers a few additional utilities, such as
- Dependency Injection