flutter_riverpod
3.5.0, released 14 days ago by dash-overflow.net
A reactive caching and data-binding framework for Flutter.
Uses material_uiRock solid
What it does
Riverpod manages app state and dependency injection while making asynchronous code easier to handle. It automatically handles error and loading states, separates business logic from the UI, and provides native support for features like pull-to-refresh.
AI-written summary of version 3.5.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need robust state management and reactive caching in a Flutter application.
- You want built-in handling of asynchronous states like loading and error handling.
- You require a scalable, highly testable dependency injection solution.
Skip it when
- You prefer a simple traditional widget state approach without global providers.
- You are already standardized on an alternative state management library like Bloc.
Strengths
- Handles errors and loading states out of the box.
- Separates logic cleanly from UI code.
- Ensures code is testable, scalable, and reusable.
Weaknesses
- Can have a steep learning curve for developers unfamiliar with provider-based patterns.
- Requires understanding reference concepts (like Ref and ProviderScope).
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 6
Wrap your root widget in a ProviderScope.
class Home extends ConsumerWidget {
@override
Widget build(BuildContext context, WidgetRef ref) {
final breweryName = ref.watch(breweryNameProvider);
return switch (breweryName) {
AsyncData(:final value) => Text('data: $value'),
AsyncError(:final error) => Text('error: $error'),
_ => const Text('loading'),
};
}
}Alternatives
Packages that do the same job and could replace flutter_riverpod.
Works with
Packages commonly used together with flutter_riverpod: ones it builds on, ones built on it, and its own family.
- riverpodflutter_riverpod depends on itA reactive caching and data-binding framework. Riverpod makes working with asynchronous code a breeze.
- state_notifierflutter_riverpod depends on itValueNotifier outside Flutter for managing state in an immutable manner.
- material_uiflutter_riverpod depends on itOfficial Flutter Material UI library implementing Google’s Material Design system.
- riverpod_annotationSame familyAnnotations for riverpod_generator to enable code generation
- riverpod_generatorSame familyGenerates Riverpod providers from annotated functions using build_runner.
- hooks_riverpodBuilt on flutter_riverpodA reactive caching, data-binding, and state management framework with flutter_hooks integration.
- whisper_ggml_plusBuilt on flutter_riverpodOn-device Whisper.cpp speech transcription plugin for Flutter.
- colorist_uiBuilt on flutter_riverpodA Flutter library of UI components for an LLM codelab.