@@ -15,6 +15,7 @@ import 'package:auto_route/auto_route.dart' as _i12;
15
15
import 'package:auto_route/empty_router_widgets.dart' as _i4;
16
16
import 'package:flutter/material.dart' as _i13;
17
17
18
+ import '../model/meal.dart' as _i17;
18
19
import '../screens/add_meal.dart' as _i11;
19
20
import '../screens/chat.dart' as _i6;
20
21
import '../screens/client_list.dart' as _i9;
@@ -85,7 +86,7 @@ class AppRouter extends _i12.RootStackRouter {
85
86
return _i12.MaterialPageX <dynamic >(
86
87
routeData: routeData, child: const _i9.ClientListScreen ());
87
88
},
88
- EmptyRouterPageRoute .name: (routeData) {
89
+ DiaryRouterPage .name: (routeData) {
89
90
return _i12.MaterialPageX <dynamic >(
90
91
routeData: routeData, child: const _i4.EmptyRouterPage ());
91
92
},
@@ -94,8 +95,10 @@ class AppRouter extends _i12.RootStackRouter {
94
95
routeData: routeData, child: const _i10.DiaryScreen ());
95
96
},
96
97
AddMealScreenRoute .name: (routeData) {
97
- return _i12.MaterialPageX <dynamic >(
98
- routeData: routeData, child: const _i11.AddMealScreen ());
98
+ final args = routeData.argsAs <AddMealScreenRouteArgs >();
99
+ return _i12.MaterialPageX <_i17.Meal ?>(
100
+ routeData: routeData,
101
+ child: _i11.AddMealScreen (day: args.day, key: args.key));
99
102
}
100
103
};
101
104
@@ -142,14 +145,14 @@ class AppRouter extends _i12.RootStackRouter {
142
145
path: 'clients' ,
143
146
parent: MainRouterPage .name,
144
147
guards: [homeGuard]),
145
- _i12.RouteConfig (EmptyRouterPageRoute .name,
148
+ _i12.RouteConfig (DiaryRouterPage .name,
146
149
path: 'diary' ,
147
150
parent: MainRouterPage .name,
148
151
children: [
149
152
_i12.RouteConfig (DiaryScreenRoute .name,
150
- path: '' , parent: EmptyRouterPageRoute .name),
153
+ path: '' , parent: DiaryRouterPage .name),
151
154
_i12.RouteConfig (AddMealScreenRoute .name,
152
- path: 'add' , parent: EmptyRouterPageRoute .name)
155
+ path: 'add' , parent: DiaryRouterPage .name)
153
156
])
154
157
]),
155
158
_i12.RouteConfig (ProfileScreenRoute .name,
@@ -251,12 +254,11 @@ class ClientListScreenRoute extends _i12.PageRouteInfo<void> {
251
254
252
255
/// generated route for
253
256
/// [_i4.EmptyRouterPage]
254
- class EmptyRouterPageRoute extends _i12.PageRouteInfo <void > {
255
- const EmptyRouterPageRoute ({List <_i12.PageRouteInfo >? children})
256
- : super (EmptyRouterPageRoute .name,
257
- path: 'diary' , initialChildren: children);
257
+ class DiaryRouterPage extends _i12.PageRouteInfo <void > {
258
+ const DiaryRouterPage ({List <_i12.PageRouteInfo >? children})
259
+ : super (DiaryRouterPage .name, path: 'diary' , initialChildren: children);
258
260
259
- static const String name = 'EmptyRouterPageRoute ' ;
261
+ static const String name = 'DiaryRouterPage ' ;
260
262
}
261
263
262
264
/// generated route for
@@ -269,8 +271,23 @@ class DiaryScreenRoute extends _i12.PageRouteInfo<void> {
269
271
270
272
/// generated route for
271
273
/// [_i11.AddMealScreen]
272
- class AddMealScreenRoute extends _i12.PageRouteInfo <void > {
273
- const AddMealScreenRoute () : super (AddMealScreenRoute .name, path: 'add' );
274
+ class AddMealScreenRoute extends _i12.PageRouteInfo <AddMealScreenRouteArgs > {
275
+ AddMealScreenRoute ({required DateTime day, _i13.Key ? key})
276
+ : super (AddMealScreenRoute .name,
277
+ path: 'add' , args: AddMealScreenRouteArgs (day: day, key: key));
274
278
275
279
static const String name = 'AddMealScreenRoute' ;
276
280
}
281
+
282
+ class AddMealScreenRouteArgs {
283
+ const AddMealScreenRouteArgs ({required this .day, this .key});
284
+
285
+ final DateTime day;
286
+
287
+ final _i13.Key ? key;
288
+
289
+ @override
290
+ String toString () {
291
+ return 'AddMealScreenRouteArgs{day: $day , key: $key }' ;
292
+ }
293
+ }
0 commit comments