mirror of
https://github.com/rrousselGit/riverpod.git
synced 2025-08-16 11:20:55 +08:00

This PR adds "{@template}" to the source code of the documentation, and provides the latest Korean translation (include comments in code) of the following pages. - introduction: 2 pages - essentials: 11 pages - from_provider: 2 pages - advanced: 1 page Thanks --------- Co-authored-by: Remi Rousselet <darky12s@gmail.com>
21 lines
410 B
Dart
21 lines
410 B
Dart
// ignore_for_file: unused_local_variable
|
|
|
|
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
|
|
|
part 'codegen.g.dart';
|
|
|
|
@riverpod
|
|
int other(OtherRef ref) => 0;
|
|
|
|
/* SNIPPET START */
|
|
@riverpod
|
|
int example(ExampleRef ref) {
|
|
// {@template provider}
|
|
// "Ref" can be used here to read other providers
|
|
// {@endtemplate}
|
|
final otherValue = ref.watch(otherProvider);
|
|
|
|
return 0;
|
|
}
|
|
/* SNIPPET END */
|