Files
MinByeongDon 02b86a2bd6 Translation [KO]: Comments in code (#3514)
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>
2024-05-07 08:51:59 +02:00

25 lines
733 B
Dart

// ignore_for_file: unused_local_variable, use_key_in_widget_constructors
import 'package:flutter/material.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
/* SNIPPET START */
// {@template provider}
// An eagerly initialized provider.
// {@endtemplate}
final exampleProvider = FutureProvider<String>((ref) async => 'Hello world');
class MyConsumer extends ConsumerWidget {
@override
Widget build(BuildContext context, WidgetRef ref) {
final result = ref.watch(exampleProvider);
// {@template note}
/// If the provider was correctly eagerly initialized, then we can
/// directly read the data with "requireValue".
// {@endtemplate}
return Text(result.requireValue);
}
}
/* SNIPPET END */