List of state management approaches

State management is a complex topic. If you feel that some of your questions haven’t been answered, or that the approach described on these pages is not viable for your use cases, you are probably right.

Learn more at the following links, many of which have been contributed by the Flutter community:

General overview

Things to review before selecting an approach.

Provider

Riverpod

Riverpod, another good choice, is similar to Provider and is compile-safe and testable. Riverpod doesn’t have a dependency on the Flutter SDK.

setState

The low-level approach to use for widget-specific, ephemeral state.

InheritedWidget & InheritedModel

The low-level approach used to communicate between ancestors and children in the widget tree. This is what provider and many other approaches use under the hood.

The following instructor-led video workshop covers how to use InheritedWidget:

Other useful docs include:

Redux

A state container approach familiar to many web developers.

Fish-Redux

Fish Redux is an assembled flutter application framework based on Redux state management. It is suitable for building medium and large applications.

BLoC / Rx

A family of stream/observable based patterns.

GetIt

A service locator based state management approach that doesn’t need a BuildContext.

MobX

A popular library based on observables and reactions.

Flutter Commands

Reactive state management that uses the Command Pattern and is based on ValueNotifiers. Best in combination with GetIt, but can be used with Provider or other locators too.

Binder

A state management package that uses InheritedWidget at its core. Inspired in part by recoil. This package promotes the separation of concerns.

GetX

A simplified reactive state management solution.

states_rebuilder

An approach that combines state management with a dependency injection solution and an integrated router. For more information, see the following info:

Triple Pattern (Segmented State Pattern)

Triple is a pattern for state management that uses Streams or ValueNotifier. This mechanism (nicknamed triple because the stream always uses three values: Error, Loading, and State), is based on the Segmented State pattern.

For more information, refer to the following resources:

solidart

A simple but powerful state management solution inspired by SolidJS.

flutter_reactive_widget

An ultra-low-boilerplate solution for state management, flutter_reactive_widget defines ReactiveWidget and ReactiveValue. Any read of a ReactiveValue’s value within a ReactiveWidget definition automatically causes the ReactiveWidget to listen for changes on the ReactiveValue.

Also includes a definition for PersistentReactiveValue, a subclass of ReactiveValue whose latest value persists, surviving app restarts.