Flutter state management that feels like Flutter
open sourceMITfree
June is a Flutter state management package that keeps Flutter's own setState pattern but moves the state out of the widget tree. You define state as a class that extends JuneState, show it with a JuneBuilder, and call setState on it from any file to rebuild the widgets that use it. It needs no MaterialApp wrapper and no manual initialization, and works with StatelessWidget. Tags give several global instances of one state class, global: false keeps a state local to one widget, and ids rebuild only selected builders. Its README compares it with provider, GetX and Bloc.
Problems it solves
- share state across my Flutter app but keep using setState the way I already know
- Flutter state management libraries make me learn a whole new architecture
- update a value in one Flutter screen from a widget in another file
- keep several separate instances of the same state class in a Flutter app
- give a Flutter form its own state that resets when I navigate away
Features
- State classes that extend JuneState, shown with JuneBuilder
- Call setState from any file to rebuild the widgets that use the state
- No MaterialApp wrapper and no manual initialization
- Several global instances of one state class through tags
- State local to one widget with global: false
- Selective rebuilds of chosen builders through ids
- Android, iOS, Linux, macOS, web and Windows
Alternatives
The same job
These do what June does.
- provider InheritedWidgets, but simple
- GetX State management, dependency injection and routing for Flutter in one package
- Bloc Predictable state management for Dart and Flutter with the BLoC pattern
- Flutter Hooks React-style hooks for Flutter widgets
- MobX.dart Reactive state management for Dart and Flutter, a port of MobX
