fluttercommunity / redux.dart

Redux for Dart
https://pub.dev/packages/redux
MIT License
515 stars 61 forks source link

design problem #47

Closed johanntony closed 5 years ago

johanntony commented 5 years ago

When Flutter want to rebuild the dom,we need to setState and call _element.markNeedsBuild(); I want to know the redux how to rebuild the dom, is it also call setState or just full rendering the dom.

brianegan commented 5 years ago

Hey there -- you can use flutter_redux for that purpose! It Provides widgets to pass the Store down your Widget tree and Widgets that connect to this Store for ya and then rebuilds Widgets whenever the Store emits a change.

There is no "DOM" in this case, it's just individual Flutter Widgets that basically call setState internally when the Store changes (and you can also reduce rebuilds if need be -- should be in the docs!)