async_redux
30.0.0, released today by glasberg.dev
A Redux-inspired state management library for Flutter.
Uses material_ui
What it does
Provides a Store, Actions, and context extensions to manage immutable app state and dispatch actions.
AI-written summary of version 30.0.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- When you need predictable state management with a unidirectional data flow
- When you prefer explicit actions and reducers
Skip it when
- When you want a more reactive or hook-based approach
Strengths
- Strong typing and immutability
- Excellent testability
- Mature and battle-tested
- Supports async actions and error handling
Weaknesses
- Verbose boilerplate
- Learning curve for Redux concepts
- Not as reactive as hook-based solutions
Setup
- Kind
- Flutter widgets
- Effort
- Medium
- Code generation
- No
- Direct dependencies
- 12
Add async_redux to pubspec, create a Store with initial state, wrap the app with StoreProvider, use context.state or context.select in widgets.
var store = Store<AppState>(initialState: AppState('Mary', 25));
Widget build(context) {
return StoreProvider<AppState>(
store: store,
child: MaterialApp(),
);
}
class MyWidget extends StatelessWidget {
Widget build(context) => Text('${context.state.name} has ${context.state.age} years old');
}
Alternatives
Packages that do the same job and could replace async_redux.
Works with
Packages commonly used together with async_redux: ones it builds on, ones built on it, and its own family.
- fileasync_redux depends on itPluggable, mockable file system abstraction for Dart with in-memory support.
- loggingasync_redux depends on itProvides configurable logging with levels and stream listeners for Dart apps.
- path_providerasync_redux depends on itProvides Flutter APIs to locate common filesystem directories on Android, iOS, macOS, Linux and Windows.
- connectivity_plusasync_redux depends on itDiscover the state of network connectivity (WiFi, mobile, ethernet) on Android, iOS, Web and desktops.
- material_uiasync_redux depends on itOfficial Flutter Material UI library implementing Google’s Material Design system.
- cupertino_uiasync_redux depends on itOfficial Flutter Cupertino design library implementing Apple HIG iOS and macOS user interfaces.
- fast_immutable_collectionsasync_redux depends on itFast immutable lists, sets, maps, and multimaps for Dart
- weak_mapasync_redux depends on itA map whose keys are weakly held, and cache functions for memoization.