talira

MobX.dart

Reactive state management for Dart and Flutter, a port of MobX

open sourceMITfree

MobX.dart brings MobX to Dart and Flutter. You mark state as observables, change it in actions, and reactions (including the UI) re-run automatically when the observables they read change. The mobx_codegen package lets you write stores with @observable, @computed and @readonly annotations instead of boilerplate, and flutter_mobx's Observer widget rebuilds only when the observables its builder uses change.

Problems it solves

  • keep my Flutter UI in sync with app state automatically
  • use MobX-style observables in a Dart app
  • rebuild only the widgets whose data changed

Features

  • observables, computed values, actions and reactions
  • annotations through mobx_codegen to cut store boilerplate
  • an Observer widget in flutter_mobx that rebuilds only on the observables it uses

Limitations

  • Its makers say they're looking for maintainers.1

Alternatives

The same job

These do what MobX.dart does.

  1. Bloc Predictable state management for Dart and Flutter with the BLoC pattern
  2. provider InheritedWidgets, but simple
  3. GetX State management, dependency injection and routing for Flutter in one package
  4. June Flutter state management that feels like Flutter

Compare MobX.dart with the top 3