flutter_riverpod
एक प्रतिक्रियाशील कैशिंग और डेटा बाइंडिंग फ्रेमवर्क। Riverpod असिंक्रोनस कोड के साथ काम करना आसान बनाता है।
एक प्रतिक्रियाशील कैशिंग और डेटा बाइंडिंग फ्रेमवर्क। Riverpod असिंक्रोनस कोड के साथ काम करना आसान बनाता है।
यह अंग्रेज़ी मूल स्नैपशॉट है। नवीनतम सामग्री GitHub पर देखें।
A reactive caching and data-binding framework. https://riverpod.dev Riverpod makes working with asynchronous code a breeze by:
| riverpod | |
|---|---|
| flutter_riverpod | |
| 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:
@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'),
};
}
}
Contributions are welcome!
Here is a curated list of how you can help:
एक प्रतिक्रियाशील कैशिंग और डेटा बाइंडिंग फ्रेमवर्क। Riverpod असिंक्रोनस कोड के साथ काम करना आसान बनाता है।
एक प्रतिक्रियाशील कैशिंग और डेटा बाइंडिंग फ्रेमवर्क। Riverpod असिंक्रोनस कोड के साथ काम करना आसान बनाता है।
एक प्रतिक्रियाशील कैशिंग और डेटा बाइंडिंग फ्रेमवर्क। Riverpod असिंक्रोनस कोड के साथ काम करना आसान बनाता है।
riverpod_generator के लिए अनुमानों को उजागर करने वाला एक पैकेज
Riverpod के लिए एक कोड जनरेटर। यह सिंटैक्स को सरल बनाता है और इसे सशक्त बनाता है, जैसे कि राज्य-आधारित हॉट-रीलोड की अनुमति देना।
उपयोग के अनुसार छाँटें, गतिविधि की तुलना करें और अपनाने से पहले मूल प्रोजेक्ट की आवश्यकताएँ जाँचें।
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗