Moved Provider to the highest

main
Kai Mannweiler 2023-03-03 16:37:08 +01:00
parent 0596194ad0
commit 37a63b0059
1 changed files with 18 additions and 18 deletions

View File

@ -28,9 +28,7 @@ class MyApp extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
TimerProvider timerProvider = TimerProvider(); TimerProvider timerProvider = TimerProvider();
return MaterialApp( return MultiProvider(
title: _title,
home: MultiProvider(
providers: [ providers: [
ChangeNotifierProvider(create: (context) => SettingsProvider()), ChangeNotifierProvider(create: (context) => SettingsProvider()),
ChangeNotifierProxyProvider<SettingsProvider, TasksProvider>( ChangeNotifierProxyProvider<SettingsProvider, TasksProvider>(
@ -45,7 +43,9 @@ class MyApp extends StatelessWidget {
ChangeNotifierProvider( ChangeNotifierProvider(
create: (context) => WorkoutProvider(timerProvider)), create: (context) => WorkoutProvider(timerProvider)),
], ],
child: const MyHomePage(), child: const MaterialApp(
title: _title,
home: MyHomePage(),
)); ));
} }
} }