Skip to content

Instantly share code, notes, and snippets.

@terryl1900
Last active July 21, 2022 23:42
Show Gist options
  • Save terryl1900/8782c221f9904468d4caa46b9f936219 to your computer and use it in GitHub Desktop.
Save terryl1900/8782c221f9904468d4caa46b9f936219 to your computer and use it in GitHub Desktop.
Inside popular Flutter state management libraries
Propagate state Library Provide data State is stored in Can combine states Easy to learn
Using Flutter widget tree setState No need Widget No Easy
InheritedWidget No need Subtree root No Easy
provider Using InheritedWidget InheritedWidget (code) No Easy
Using Stream flutter_bloc Using provider Provider (state, provider, stream) No Easy
flutter_redux Using InheritedWidget InheritedWidget (state, InheritedWidget, stream) No Easy
Using subscription riverpod No need Centralized (state, propagate) Yes Medium
flutter_mobx No need Rx variable (state, propagate) Yes Medium
getx No need Rx variable (state, stream) Partial Medium
Using graph creator No need Centralized (state, propagate) Yes Easy

Notes:

  • Provide data means that the state has to be "provided" by a special widget, whose job is to store state and make it accessible to its subtree.
  • Can combine states means that user can easily access several states to build widget, or combine states to generate new states.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment