Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rrousselGit/riverpod
A reactive caching and data-binding framework. Riverpod makes working with asynchronous code a breeze.
https://github.com/rrousselGit/riverpod
dart flutter hacktoberfest inheritedwidget provider riverpod service-locator state-management
Last synced: about 1 month ago
JSON representation
A reactive caching and data-binding framework. Riverpod makes working with asynchronous code a breeze.
- Host: GitHub
- URL: https://github.com/rrousselGit/riverpod
- Owner: rrousselGit
- License: mit
- Created: 2020-04-16T10:40:29.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2024-04-23T09:42:44.000Z (about 1 month ago)
- Last Synced: 2024-04-24T19:56:59.921Z (about 1 month ago)
- Topics: dart, flutter, hacktoberfest, inheritedwidget, provider, riverpod, service-locator, state-management
- Language: Dart
- Homepage: https://riverpod.dev
- Size: 31.4 MB
- Stars: 5,772
- Watchers: 76
- Forks: 885
- Open Issues: 79
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Lists
- awesome-flutter - RiverPod - Provider, but different by [Remi Rousselet](https://github.com/rrousselGit). (Frameworks / State management)
- awesome-stars - riverpod
- awesome-flutter - riverpod - A reactive caching and data-binding framework. [riverpod.dev](https://riverpod.dev) 。对provider优化。 (状态管理)
- awesome-stars - riverpod - binding framework. Riverpod makes working with asynchronous code a breeze. | rrousselGit | 5844 | (Dart)
README
---
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](https://img.shields.io/pub/v/riverpod.svg?label=riverpod&color=blue)](https://pub.dartlang.org/packages/riverpod) |
| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| flutter_riverpod | [![pub package](https://img.shields.io/pub/v/riverpod.svg?label=flutter_riverpod&color=blue)](https://pub.dartlang.org/packages/flutter_riverpod) |
| hooks_riverpod | [![pub package](https://img.shields.io/pub/v/riverpod.svg?label=hooks_riverpod&color=blue)](https://pub.dartlang.org/packages/hooks_riverpod) |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`:
```dart
@riverpod
Future boredSuggestion(BoredSuggestionRef ref) async {
final response = await http.get(
Uri.https('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.
```dart
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 boredSuggestion.when(
loading: () => Text('loading'),
error: (error, stackTrace) => Text('error: $error'),
data: (data) => Text(data),
);
}
}
```## 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
[provider]: https://github.com/rrousselGit/provider
[riverpod]: https://github.com/rrousselGit/riverpod
[flutter_hooks]: https://github.com/rrousselGit/flutter_hooks
[inheritedwidget]: https://api.flutter.dev/flutter/widgets/InheritedWidget-class.html
[hooks_riverpod]: https://pub.dev/packages/hooks_riverpod
[flutter_riverpod]: https://pub.dev/packages/flutter_riverpod