riverpod 3.0.0-dev.0 copy "riverpod: ^3.0.0-dev.0" to clipboard
riverpod: ^3.0.0-dev.0 copied to clipboard

A simple way to access state from anywhere in your application while robust and testable.

Build Status codecov Star on Github License: MIT Discord

Deploys by Netlify


A reactive caching and data-binding framework. https://riverpod.dev
Riverpod makes working with asynchronous code a breeze by:

  • handling errors/loading states by default. No need to manually catch errors
  • natively supporting advanced scenarios, such as pull-to-refresh
  • separating the logic from your UI
  • ensuring your code is testable, scalable and reusable
riverpod pub package
flutter_riverpod pub package
hooks_riverpod pub package

Welcome to Riverpod (anagram of Provider)!

For learning how to use Riverpod, see its documentation:
>>> https://riverpod.dev <<<

Long story short:

  • Define network requests by writing a function annotated with @riverpod:

    Future<String> boredSuggestion(BoredSuggestionRef ref) async {
      final response = await http.get(
      final json = jsonDecode(response.body);
      return json['activity']! as String;
  • Listen to the network request in your UI and gracefully handle loading/error states.

    class Home extends ConsumerWidget {
      Widget build(BuildContext context, WidgetRef ref) {
        final boredSuggestion = ref.watch(boredSuggestionProvider);
        // Perform a switch-case on the result to handle loading/error states
        return boredSuggestion.when(
          loading: () => Text('loading'),
          error: (error, stackTrace) => Text('error: $error'),
          data: (data) => Text(data),

See the FAQ if you have questions about what this means for provider.

Contributing #

Contributions are welcomed!

Here is a curated list of how you can help:

  • Report bugs and scenarios that are difficult to implement
  • Report parts of the documentation that are unclear
  • Fix typos/grammar mistakes
  • Update the documentation / add examples
  • Implement new features by making a pull-request

Sponsors #

pub points


verified publisherdash-overflow.net

A simple way to access state from anywhere in your application while robust and testable.

Repository (GitHub)
View/report issues


Consider supporting this project:



unknown (LICENSE)


meta, stack_trace, state_notifier


Packages that depend on riverpod