diff --git a/lib/mains/gt.dart b/lib/mains/gt.dart index 04e6ca2..eae4bf5 100644 --- a/lib/mains/gt.dart +++ b/lib/mains/gt.dart @@ -18,7 +18,7 @@ void main() { // For widgets to be able to read providers, we need to wrap the entire // application in a "ProviderScope" widget. // This is where the state of our providers will be stored. - ProviderScope( + const ProviderScope( child: MyApp(), ), ); @@ -26,6 +26,8 @@ void main() { // Extend ConsumerWidget instead of StatelessWidget, which is exposed by Riverpod class MyApp extends ConsumerWidget { + const MyApp({super.key}); + @override Widget build(BuildContext context, WidgetRef ref) { final String value = ref.watch(helloWorldProvider); @@ -36,9 +38,9 @@ class MyApp extends ConsumerWidget { body: Center( child: Column( children: [ - Expanded(child: Text('1')), + const Expanded(child: Text('1')), Expanded(child: Text(value)), - Expanded(child: RandomWidget()) + const Expanded(child: RandomWidget()) ], ) diff --git a/lib/outerapi/auth/call/getRandomData.dart b/lib/outerapi/auth/call/getRandomData.dart index 5db6b74..dd2c96a 100644 --- a/lib/outerapi/auth/call/getRandomData.dart +++ b/lib/outerapi/auth/call/getRandomData.dart @@ -2,7 +2,6 @@ // GET http://localhost:3000/p/random import 'dart:convert'; -import 'dart:io'; import 'package:http/http.dart' as http; import 'package:riverpod_annotation/riverpod_annotation.dart'; import '../model/my_random.dart'; diff --git a/lib/widgets/simples/random.dart b/lib/widgets/simples/random.dart index 730ab9e..07e1eee 100644 --- a/lib/widgets/simples/random.dart +++ b/lib/widgets/simples/random.dart @@ -19,7 +19,7 @@ class RandomWidget extends StatelessWidget { return Center( child: switch (myRandom) { AsyncData(:final MyRandom value ) => Text( - 'myRandom: ${value}' + 'myRandom: $value' ), AsyncError() => const Text('Oops, something unexpected happened'), _ => const CircularProgressIndicator(),