diff --git a/examples/random_number/lib/main.dart b/examples/random_number/lib/main.dart index d7ce8f78d..6b5751916 100644 --- a/examples/random_number/lib/main.dart +++ b/examples/random_number/lib/main.dart @@ -7,19 +7,20 @@ void main() { runApp(const ProviderScope(child: RandomNumberApp())); } -// State notifier for generating a random number exposed by a state notifier +// Notifier for generating a random number exposed by a state notifier // provider -class RandomNumberGenerator extends Notifier { +class RandomNumberGenerator extends Notifier { @override int build() => Random().nextInt(9999); - + void generate() { state = Random().nextInt(9999); } } -// State notifier provider holding the state -final randomNumberProvider = NotifierProvider(RandomNumberGenerator.new); +// Notifier provider holding the state +final randomNumberProvider = + NotifierProvider(RandomNumberGenerator.new); class RandomNumberApp extends StatelessWidget { const RandomNumberApp({super.key});