Moved Provider to the highest
parent
0596194ad0
commit
37a63b0059
|
@ -28,24 +28,24 @@ 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,
|
providers: [
|
||||||
home: MultiProvider(
|
ChangeNotifierProvider(create: (context) => SettingsProvider()),
|
||||||
providers: [
|
ChangeNotifierProxyProvider<SettingsProvider, TasksProvider>(
|
||||||
ChangeNotifierProvider(create: (context) => SettingsProvider()),
|
create: (context) => TasksProvider(null),
|
||||||
ChangeNotifierProxyProvider<SettingsProvider, TasksProvider>(
|
update: (context, value, TasksProvider? previous) =>
|
||||||
create: (context) => TasksProvider(null),
|
TasksProvider(value),
|
||||||
update: (context, value, TasksProvider? previous) =>
|
),
|
||||||
TasksProvider(value),
|
ChangeNotifierProvider(
|
||||||
),
|
create: (context) => PageProvider(),
|
||||||
ChangeNotifierProvider(
|
),
|
||||||
create: (context) => PageProvider(),
|
ChangeNotifierProvider(create: (context) => timerProvider),
|
||||||
),
|
ChangeNotifierProvider(
|
||||||
ChangeNotifierProvider(create: (context) => timerProvider),
|
create: (context) => WorkoutProvider(timerProvider)),
|
||||||
ChangeNotifierProvider(
|
],
|
||||||
create: (context) => WorkoutProvider(timerProvider)),
|
child: const MaterialApp(
|
||||||
],
|
title: _title,
|
||||||
child: const MyHomePage(),
|
home: MyHomePage(),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue