Remi Rousselet 6b8a0aa1ab Update deps
2026-03-09 14:07:09 +01:00
2026-01-06 17:26:07 +01:00
2026-01-17 12:17:06 +01:00
2026-03-09 14:07:09 +01:00
2026-03-09 14:06:16 +01:00
2023-09-04 11:00:48 +02:00
2024-10-20 14:41:51 +02:00
2025-04-20 17:58:08 +02:00
2025-11-17 12:12:17 +02:00
2022-02-27 14:34:11 +01:00
2025-03-06 17:46:57 +01:00
2025-06-20 01:23:40 +02:00
2020-04-17 19:14:29 +01:00
2026-01-17 12:22:35 +01:00

Build Status codecov Star on Github License: MIT Discord

Deploys by Netlify

Riverpod


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:

    @riverpod
    Future<String> boredSuggestion(Ref ref) async {
      final response = await http.get(
        Uri.https('boredapi.com', '/api/activity'),
      );
      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 {
      @override
      Widget build(BuildContext context, WidgetRef ref) {
        final boredSuggestion = ref.watch(boredSuggestionProvider);
        // Perform a switch-case on the result to handle loading/error states
        return switch (boredSuggestion) {
          AsyncData(:final value) => Text('data: $value'),
          AsyncError(:final error) => Text('error: $error'),
          _ => const Text('loading'),
        };
      }
    }
    

Contributing

Contributions are welcome!

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 or add examples
  • Implement new features by making a pull-request

Sponsors

Description
A reactive caching and data-binding framework. Riverpod makes working with asynchronous code a breeze.
Readme MIT 74 MiB
Languages
PostScript 52.8%
Dart 24.1%
MDX 22.1%
JavaScript 0.5%
TypeScript 0.4%