|
11 | 11 | // ignore_for_file: type=lint
|
12 | 12 |
|
13 | 13 | // ignore_for_file: no_leading_underscores_for_library_prefixes
|
14 |
| -import 'package:auto_route/auto_route.dart' as _i5; |
15 |
| -import 'package:flutter/material.dart' as _i6; |
| 14 | +import 'package:auto_route/auto_route.dart' as _i7; |
| 15 | +import 'package:flutter/material.dart' as _i8; |
16 | 16 |
|
17 |
| -import '../screens/chat.dart' as _i2; |
18 |
| -import '../screens/diary.dart' as _i1; |
19 |
| -import '../screens/login.dart' as _i3; |
20 |
| -import '../screens/register.dart' as _i4; |
| 17 | +import '../screens/chat.dart' as _i4; |
| 18 | +import '../screens/diary.dart' as _i5; |
| 19 | +import '../screens/home.dart' as _i1; |
| 20 | +import '../screens/login.dart' as _i2; |
| 21 | +import '../screens/profile.dart' as _i6; |
| 22 | +import '../screens/register.dart' as _i3; |
21 | 23 |
|
22 |
| -class AppRouter extends _i5.RootStackRouter { |
23 |
| - AppRouter([_i6.GlobalKey<_i6.NavigatorState>? navigatorKey]) |
| 24 | +class AppRouter extends _i7.RootStackRouter { |
| 25 | + AppRouter([_i8.GlobalKey<_i8.NavigatorState>? navigatorKey]) |
24 | 26 | : super(navigatorKey);
|
25 | 27 |
|
26 | 28 | @override
|
27 |
| - final Map<String, _i5.PageFactory> pagesMap = { |
28 |
| - DiaryScreenRoute.name: (routeData) { |
29 |
| - return _i5.MaterialPageX<dynamic>( |
30 |
| - routeData: routeData, child: const _i1.DiaryScreen()); |
31 |
| - }, |
32 |
| - ChatScreenRoute.name: (routeData) { |
33 |
| - return _i5.MaterialPageX<dynamic>( |
34 |
| - routeData: routeData, child: const _i2.ChatScreen()); |
| 29 | + final Map<String, _i7.PageFactory> pagesMap = { |
| 30 | + HomeScreenRoute.name: (routeData) { |
| 31 | + return _i7.MaterialPageX<dynamic>( |
| 32 | + routeData: routeData, child: const _i1.HomeScreen()); |
35 | 33 | },
|
36 | 34 | LoginScreenRoute.name: (routeData) {
|
37 |
| - return _i5.MaterialPageX<dynamic>( |
38 |
| - routeData: routeData, child: const _i3.LoginScreen()); |
| 35 | + return _i7.MaterialPageX<dynamic>( |
| 36 | + routeData: routeData, child: const _i2.LoginScreen()); |
39 | 37 | },
|
40 | 38 | RegisterScreenRoute.name: (routeData) {
|
41 |
| - return _i5.MaterialPageX<dynamic>( |
42 |
| - routeData: routeData, child: const _i4.RegisterScreen()); |
| 39 | + return _i7.MaterialPageX<dynamic>( |
| 40 | + routeData: routeData, child: const _i3.RegisterScreen()); |
| 41 | + }, |
| 42 | + ChatScreenRoute.name: (routeData) { |
| 43 | + return _i7.MaterialPageX<dynamic>( |
| 44 | + routeData: routeData, child: const _i4.ChatScreen()); |
| 45 | + }, |
| 46 | + DiaryScreenRoute.name: (routeData) { |
| 47 | + return _i7.MaterialPageX<dynamic>( |
| 48 | + routeData: routeData, child: const _i5.DiaryScreen()); |
| 49 | + }, |
| 50 | + ProfileScreenRoute.name: (routeData) { |
| 51 | + return _i7.MaterialPageX<dynamic>( |
| 52 | + routeData: routeData, child: const _i6.ProfileScreen()); |
43 | 53 | }
|
44 | 54 | };
|
45 | 55 |
|
46 | 56 | @override
|
47 |
| - List<_i5.RouteConfig> get routes => [ |
48 |
| - _i5.RouteConfig('/#redirect', |
49 |
| - path: '/', redirectTo: '/diary', fullMatch: true), |
50 |
| - _i5.RouteConfig(DiaryScreenRoute.name, path: '/diary'), |
51 |
| - _i5.RouteConfig(ChatScreenRoute.name, path: '/chat'), |
52 |
| - _i5.RouteConfig(LoginScreenRoute.name, path: '/login'), |
53 |
| - _i5.RouteConfig(RegisterScreenRoute.name, path: '/register'), |
54 |
| - _i5.RouteConfig('*#redirect', |
55 |
| - path: '*', redirectTo: '/diary', fullMatch: true) |
| 57 | + List<_i7.RouteConfig> get routes => [ |
| 58 | + _i7.RouteConfig('/#redirect', |
| 59 | + path: '/', redirectTo: '/home', fullMatch: true), |
| 60 | + _i7.RouteConfig(HomeScreenRoute.name, path: '/home', children: [ |
| 61 | + _i7.RouteConfig('#redirect', |
| 62 | + path: '', |
| 63 | + parent: HomeScreenRoute.name, |
| 64 | + redirectTo: 'diary', |
| 65 | + fullMatch: true), |
| 66 | + _i7.RouteConfig(ChatScreenRoute.name, |
| 67 | + path: 'chat', parent: HomeScreenRoute.name), |
| 68 | + _i7.RouteConfig(DiaryScreenRoute.name, |
| 69 | + path: 'diary', parent: HomeScreenRoute.name), |
| 70 | + _i7.RouteConfig(ProfileScreenRoute.name, |
| 71 | + path: 'my', parent: HomeScreenRoute.name) |
| 72 | + ]), |
| 73 | + _i7.RouteConfig(LoginScreenRoute.name, path: '/login'), |
| 74 | + _i7.RouteConfig(RegisterScreenRoute.name, path: '/register'), |
| 75 | + _i7.RouteConfig('*#redirect', |
| 76 | + path: '*', redirectTo: '/home/diary', fullMatch: true) |
56 | 77 | ];
|
57 | 78 | }
|
58 | 79 |
|
59 | 80 | /// generated route for
|
60 |
| -/// [_i1.DiaryScreen] |
61 |
| -class DiaryScreenRoute extends _i5.PageRouteInfo<void> { |
62 |
| - const DiaryScreenRoute() : super(DiaryScreenRoute.name, path: '/diary'); |
63 |
| - |
64 |
| - static const String name = 'DiaryScreenRoute'; |
65 |
| -} |
| 81 | +/// [_i1.HomeScreen] |
| 82 | +class HomeScreenRoute extends _i7.PageRouteInfo<void> { |
| 83 | + const HomeScreenRoute({List<_i7.PageRouteInfo>? children}) |
| 84 | + : super(HomeScreenRoute.name, path: '/home', initialChildren: children); |
66 | 85 |
|
67 |
| -/// generated route for |
68 |
| -/// [_i2.ChatScreen] |
69 |
| -class ChatScreenRoute extends _i5.PageRouteInfo<void> { |
70 |
| - const ChatScreenRoute() : super(ChatScreenRoute.name, path: '/chat'); |
71 |
| - |
72 |
| - static const String name = 'ChatScreenRoute'; |
| 86 | + static const String name = 'HomeScreenRoute'; |
73 | 87 | }
|
74 | 88 |
|
75 | 89 | /// generated route for
|
76 |
| -/// [_i3.LoginScreen] |
77 |
| -class LoginScreenRoute extends _i5.PageRouteInfo<void> { |
| 90 | +/// [_i2.LoginScreen] |
| 91 | +class LoginScreenRoute extends _i7.PageRouteInfo<void> { |
78 | 92 | const LoginScreenRoute() : super(LoginScreenRoute.name, path: '/login');
|
79 | 93 |
|
80 | 94 | static const String name = 'LoginScreenRoute';
|
81 | 95 | }
|
82 | 96 |
|
83 | 97 | /// generated route for
|
84 |
| -/// [_i4.RegisterScreen] |
85 |
| -class RegisterScreenRoute extends _i5.PageRouteInfo<void> { |
| 98 | +/// [_i3.RegisterScreen] |
| 99 | +class RegisterScreenRoute extends _i7.PageRouteInfo<void> { |
86 | 100 | const RegisterScreenRoute()
|
87 | 101 | : super(RegisterScreenRoute.name, path: '/register');
|
88 | 102 |
|
89 | 103 | static const String name = 'RegisterScreenRoute';
|
90 | 104 | }
|
| 105 | + |
| 106 | +/// generated route for |
| 107 | +/// [_i4.ChatScreen] |
| 108 | +class ChatScreenRoute extends _i7.PageRouteInfo<void> { |
| 109 | + const ChatScreenRoute() : super(ChatScreenRoute.name, path: 'chat'); |
| 110 | + |
| 111 | + static const String name = 'ChatScreenRoute'; |
| 112 | +} |
| 113 | + |
| 114 | +/// generated route for |
| 115 | +/// [_i5.DiaryScreen] |
| 116 | +class DiaryScreenRoute extends _i7.PageRouteInfo<void> { |
| 117 | + const DiaryScreenRoute() : super(DiaryScreenRoute.name, path: 'diary'); |
| 118 | + |
| 119 | + static const String name = 'DiaryScreenRoute'; |
| 120 | +} |
| 121 | + |
| 122 | +/// generated route for |
| 123 | +/// [_i6.ProfileScreen] |
| 124 | +class ProfileScreenRoute extends _i7.PageRouteInfo<void> { |
| 125 | + const ProfileScreenRoute() : super(ProfileScreenRoute.name, path: 'my'); |
| 126 | + |
| 127 | + static const String name = 'ProfileScreenRoute'; |
| 128 | +} |
0 commit comments