=> HogeNotifer(), child: MyApp(), ); } • ΞϓϦͷϧʔτͰએݴ
→ProviderΛฤू͢Δͨͼʹ main.dartΛߦ͖དྷ… • ProviderScopeԼͳΒͲ͜ͰએݴՄೳ
→WidgetͱProviderΛ1ϑΝΠϧʹूͰ͖Δ main.dart void main() { runApp( ProviderScope( child: MyApp(), ), ); } app.dart final hogeProvider = StateNotifierProvider((ref) => HogeNotifier() ); class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( home: Scaffold( body: Consumer( (context, read) { final hoge = read(hogeProvider); return Text(hoge); }, ), ), ); } } 16