flutter_rearch
1.7.3, released 5 months ago by gsconrad.com
Declarative state management and dependency injection using capsules and side effects
WASM-ready
What it does
Provides a re-imagined architectural approach for applications through capsules, incremental computation, and side effects. It allows managing state and building UI as pure functions of state and side effects.
AI-written summary of version 1.7.3, based on the package's README and metadata. Report an inaccuracy
Use it when
- You want a declarative state management and dependency injection system similar to Riverpod without family or autoDispose complexity
- You want high testability with pure functions and minimal need for complex mocks
Skip it when
- You prefer traditional class-based BLoCs or standard Flutter InheritedWidgets
- You are not willing to wrap your application in a RearchBootstrapper
Strengths
- Enables feature composition through side effects
- Automatic cleanup of idempotent capsules
- High testability with pure functions
Weaknesses
- Requires learning a brand new capsule and side effect mental model
- Smaller ecosystem and community compared to established alternatives like Provider, Riverpod, or Bloc
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 2
Wrap your application widget with a RearchBootstrapper widget in your main.dart.
final Capsule<(int, void Function())> countManager = capsule((CapsuleHandle use) {
final (count, setCount) = use.state(0);
return (count, () => setCount(count + 1));
});Alternatives
Packages that do the same job and could replace flutter_rearch.
Works with
Packages commonly used together with flutter_rearch: ones it builds on, ones built on it, and its own family.