File tree Expand file tree Collapse file tree 2 files changed +37
-25
lines changed
packages/go_router_builder/example/lib Expand file tree Collapse file tree 2 files changed +37
-25
lines changed Original file line number Diff line number Diff line change
1
+ // Copyright 2013 The Flutter Authors. All rights reserved.
2
+ // Use of this source code is governed by a BSD-style license that can be
3
+ // found in the LICENSE file.
4
+
5
+ // ignore_for_file: public_member_api_docs, unreachable_from_main
6
+
7
+ import 'package:flutter/material.dart' ;
8
+ import 'package:go_router/go_router.dart' ;
9
+
10
+ import 'stateful_shell_route_initial_location_example.dart' ;
11
+
12
+ class OrdersRouteData extends GoRouteData with $OrdersRouteData {
13
+ const OrdersRouteData ();
14
+
15
+ @override
16
+ Widget build (BuildContext context, GoRouterState state) {
17
+ return const OrdersPageView (label: 'Orders page' );
18
+ }
19
+ }
20
+
21
+ class OrdersPageView extends StatelessWidget {
22
+ const OrdersPageView ({
23
+ required this .label,
24
+ super .key,
25
+ });
26
+
27
+ final String label;
28
+
29
+ @override
30
+ Widget build (BuildContext context) {
31
+ return Center (
32
+ child: Text (label),
33
+ );
34
+ }
35
+ }
Original file line number Diff line number Diff line change 7
7
import 'package:flutter/material.dart' ;
8
8
import 'package:go_router/go_router.dart' ;
9
9
10
+ import 'separate_file_route.dart' ;
11
+
10
12
part 'stateful_shell_route_initial_location_example.g.dart' ;
11
13
12
14
void main () => runApp (App ());
@@ -118,15 +120,6 @@ class NotificationsRouteData extends GoRouteData with $NotificationsRouteData {
118
120
}
119
121
}
120
122
121
- class OrdersRouteData extends GoRouteData with $OrdersRouteData {
122
- const OrdersRouteData ();
123
-
124
- @override
125
- Widget build (BuildContext context, GoRouterState state) {
126
- return const OrdersPageView (label: 'Orders page' );
127
- }
128
- }
129
-
130
123
class MainPageView extends StatelessWidget {
131
124
const MainPageView ({
132
125
required this .navigationShell,
@@ -258,19 +251,3 @@ class NotificationsSubPageView extends StatelessWidget {
258
251
);
259
252
}
260
253
}
261
-
262
- class OrdersPageView extends StatelessWidget {
263
- const OrdersPageView ({
264
- required this .label,
265
- super .key,
266
- });
267
-
268
- final String label;
269
-
270
- @override
271
- Widget build (BuildContext context) {
272
- return Center (
273
- child: Text (label),
274
- );
275
- }
276
- }
You can’t perform that action at this time.
0 commit comments