Skip to content

Commit 01d710f

Browse files
committed
Update example tests
1 parent e2e957e commit 01d710f

File tree

3 files changed

+39
-27
lines changed

3 files changed

+39
-27
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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+
}

packages/go_router_builder/example/lib/stateful_shell_route_initial_location_example.dart

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
import 'package:flutter/material.dart';
88
import 'package:go_router/go_router.dart';
99

10+
import 'separate_file_route.dart';
11+
1012
part 'stateful_shell_route_initial_location_example.g.dart';
1113

1214
void main() => runApp(App());
@@ -118,15 +120,6 @@ class NotificationsRouteData extends GoRouteData with _$NotificationsRouteData {
118120
}
119121
}
120122

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-
130123
class MainPageView extends StatelessWidget {
131124
const MainPageView({
132125
required this.navigationShell,
@@ -258,19 +251,3 @@ class NotificationsSubPageView extends StatelessWidget {
258251
);
259252
}
260253
}
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-
}

packages/go_router_builder/example/lib/stateful_shell_route_initial_location_example.g.dart

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)