Moved Provider to the highest
parent
0596194ad0
commit
37a63b0059
|
@ -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<SettingsProvider, TasksProvider>(
|
||||
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<SettingsProvider, TasksProvider>(
|
||||
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(),
|
||||
));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue