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 ↗