From 37a63b00592247b276adeb5f8f53a56698613990 Mon Sep 17 00:00:00 2001 From: "k.mannweiler" <2012491@stud.hs-mannheim.de> Date: Fri, 3 Mar 2023 16:37:08 +0100 Subject: [PATCH] Moved Provider to the highest --- lib/main.dart | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index 4e6924d..e2d6e90 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -28,24 +28,24 @@ class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { TimerProvider timerProvider = TimerProvider(); - return MaterialApp( - title: _title, - home: MultiProvider( - providers: [ - ChangeNotifierProvider(create: (context) => SettingsProvider()), - ChangeNotifierProxyProvider( - create: (context) => TasksProvider(null), - update: (context, value, TasksProvider? previous) => - TasksProvider(value), - ), - ChangeNotifierProvider( - create: (context) => PageProvider(), - ), - ChangeNotifierProvider(create: (context) => timerProvider), - ChangeNotifierProvider( - create: (context) => WorkoutProvider(timerProvider)), - ], - child: const MyHomePage(), + return MultiProvider( + providers: [ + ChangeNotifierProvider(create: (context) => SettingsProvider()), + ChangeNotifierProxyProvider( + create: (context) => TasksProvider(null), + update: (context, value, TasksProvider? previous) => + TasksProvider(value), + ), + ChangeNotifierProvider( + create: (context) => PageProvider(), + ), + ChangeNotifierProvider(create: (context) => timerProvider), + ChangeNotifierProvider( + create: (context) => WorkoutProvider(timerProvider)), + ], + child: const MaterialApp( + title: _title, + home: MyHomePage(), )); } }