2a29701f
liangchengyou
feat:提交代码
|
1
2
|
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
|
a117a5a3
liangchengyou
feat:更新代码
|
3
|
import 'package:wow_english/app/splash_page.dart';
|
bfb40cd0
liangchengyou
feat:忘记密码获取验证码
|
4
|
import 'package:wow_english/common/pages/wow_web_page.dart';
|
4b358e22
liangchengyou
feat:调整文件结构
|
5
6
7
8
9
10
|
import 'package:wow_english/pages/home/home_page.dart';
import 'package:wow_english/pages/lessons/lesson_page.dart';
import 'package:wow_english/pages/listen/listen_page.dart';
import 'package:wow_english/pages/login/forgetpwd/forget_password_home_page.dart';
import 'package:wow_english/pages/login/loginpage/login_page.dart';
import 'package:wow_english/pages/login/setpwd/set_pwd_page.dart';
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
11
|
import 'package:wow_english/pages/practice/topic_picture_page.dart';
|
4b358e22
liangchengyou
feat:调整文件结构
|
12
|
import 'package:wow_english/pages/repeatafter/repeat_after_page.dart';
|
08a0f5a8
liangchengyou
feat:路由方式更新
|
13
|
import 'package:wow_english/pages/repeataftercontent/repeat_after_content_page.dart';
|
4b358e22
liangchengyou
feat:调整文件结构
|
14
15
16
17
|
import 'package:wow_english/pages/shop/exchane/exchange_lesson_page.dart';
import 'package:wow_english/pages/shop/exchangelist/exchange_lesson_list_page.dart';
import 'package:wow_english/pages/shop/home/shop_home_page.dart';
import 'package:wow_english/pages/tab/tab_page.dart';
|
da82bd70
Key
feat: user_inform...
|
18
|
import 'package:wow_english/pages/user/information/user_information_page.dart';
|
c9df43c8
Key
feat: 修改个人信息、接口
|
19
|
import 'package:wow_english/pages/user/modify/modify_user_information_page.dart';
|
4b358e22
liangchengyou
feat:调整文件结构
|
20
21
|
import 'package:wow_english/pages/user/user_page.dart';
import 'package:wow_english/pages/video/lookvideo/look_video_page.dart';
|
4b358e22
liangchengyou
feat:调整文件结构
|
22
|
|
2a427e12
吴启风
feat:绘本静态ui基本完成
|
23
24
|
import '../pages/reading/reading_page.dart';
|
2a29701f
liangchengyou
feat:提交代码
|
25
26
27
|
class AppRouteName {
static const String splash = 'splash';
static const String login = 'login';
|
95edef4f
liangchengyou
feat:更新适配代码
|
28
|
static const String home = 'home';
|
4bf67b91
liangchengyou
feat:设置密码
|
29
|
static const String fogPwd = 'fogPwd';
|
c61b3c1a
Key
feat: toast_util....
|
30
|
|
c9df43c8
Key
feat: 修改个人信息、接口
|
31
32
|
/// 设置密码,修改密码;不要自己调用,使用[SetPassWordPage.push]方法,隐藏这种实现
//static const String setPwd = 'setPwd';
|
bfb40cd0
liangchengyou
feat:忘记密码获取验证码
|
33
|
static const String webView = 'webView';
|
60e47f7c
liangchengyou
feat:课程选择功能
|
34
|
static const String lesson = 'lesson';
|
d35a4e87
liangchengyou
feat:磨耳朵功能UI
|
35
|
static const String listen = 'listen';
|
d1d32220
liangchengyou
feat:兑换课程+购买记录
|
36
37
38
|
static const String shop = 'shop';
static const String exLesson = 'exLesson';
static const String exList = 'exList';
|
9d080046
liangchengyou
feat:视频跟读逻辑
|
39
|
static const String reAfter = 'reAfter';
|
624214d0
liangchengyou
feat:看题选字/选图UI和部分逻辑
|
40
|
static const String topicPic = 'topicPic';
|
22b7d4da
Key
feat: user, api path
|
41
|
static const String user = 'user';
|
da82bd70
Key
feat: user_inform...
|
42
43
44
|
/// 用户详细信息页
static const String userInformation = 'userInformation';
|
c9df43c8
Key
feat: 修改个人信息、接口
|
45
46
47
|
/// 用户修改信息页,不要自己调用,使用[ModifyUserInformationPage.push]方法,隐藏这种实现
//static const String userModifyInformation = 'userModifyInformation';
|
08a0f5a8
liangchengyou
feat:路由方式更新
|
48
|
///看视频
|
119ba920
liangchengyou
feat:视频播放器
|
49
|
static const String lookVideo = 'lookVideo';
|
08a0f5a8
liangchengyou
feat:路由方式更新
|
50
|
///绘本
|
c61b3c1a
Key
feat: toast_util....
|
51
|
static const String reading = 'reading';
|
08a0f5a8
liangchengyou
feat:路由方式更新
|
52
53
54
|
///视频跟读详情
static const String readAfterContent = 'readAfterContent';
|
c61b3c1a
Key
feat: toast_util....
|
55
|
|
2a29701f
liangchengyou
feat:提交代码
|
56
57
58
59
60
|
static const String tab = '/';
}
class AppRouter {
static final navigatorKey = GlobalKey<NavigatorState>();
|
94342c3f
Key
feat: user util
|
61
|
|
2a29701f
liangchengyou
feat:提交代码
|
62
63
|
// App 根节点Context
static BuildContext get context => navigatorKey.currentContext!;
|
22b7d4da
Key
feat: user, api path
|
64
|
|
2a29701f
liangchengyou
feat:提交代码
|
65
66
67
68
69
|
static Route<dynamic> generateRoute(RouteSettings settings) {
switch (settings.name) {
case AppRouteName.splash:
return PageRouteBuilder(
opaque: false,
|
94342c3f
Key
feat: user util
|
70
|
pageBuilder: (_, __, ___) => const SplashPage(),
|
2a29701f
liangchengyou
feat:提交代码
|
71
72
73
|
transitionDuration: Duration.zero,
transitionsBuilder: (_, __, ___, child) => child);
case AppRouteName.login:
|
94342c3f
Key
feat: user util
|
74
|
return CupertinoPageRoute(builder: (_) => const LoginPage());
|
95edef4f
liangchengyou
feat:更新适配代码
|
75
|
case AppRouteName.home:
|
8988aa69
liangchengyou
feat:首页+课程列表数据获取
|
76
77
78
79
|
var moduleId = '';
if (settings.arguments != null) {
moduleId = (settings.arguments as Map)['moduleId'] as String;
}
|
c61b3c1a
Key
feat: toast_util....
|
80
81
82
83
|
return CupertinoPageRoute(
builder: (_) => HomePage(
moduleId: moduleId,
));
|
4bf67b91
liangchengyou
feat:设置密码
|
84
|
case AppRouteName.fogPwd:
|
94342c3f
Key
feat: user util
|
85
|
return CupertinoPageRoute(builder: (_) => const ForgetPasswordHomePage());
|
60e47f7c
liangchengyou
feat:课程选择功能
|
86
|
case AppRouteName.lesson:
|
94342c3f
Key
feat: user util
|
87
|
return CupertinoPageRoute(builder: (_) => const LessonPage());
|
d35a4e87
liangchengyou
feat:磨耳朵功能UI
|
88
|
case AppRouteName.listen:
|
94342c3f
Key
feat: user util
|
89
|
return CupertinoPageRoute(builder: (_) => const ListenPage());
|
d1d32220
liangchengyou
feat:兑换课程+购买记录
|
90
|
case AppRouteName.shop:
|
94342c3f
Key
feat: user util
|
91
|
return CupertinoPageRoute(builder: (_) => const ShopHomePage());
|
d1d32220
liangchengyou
feat:兑换课程+购买记录
|
92
|
case AppRouteName.exLesson:
|
94342c3f
Key
feat: user util
|
93
|
return CupertinoPageRoute(builder: (_) => const ExchangeLessonPage());
|
d1d32220
liangchengyou
feat:兑换课程+购买记录
|
94
|
case AppRouteName.exList:
|
94342c3f
Key
feat: user util
|
95
|
return CupertinoPageRoute(builder: (_) => const ExchangeLessonListPage());
|
9d080046
liangchengyou
feat:视频跟读逻辑
|
96
|
case AppRouteName.reAfter:
|
94342c3f
Key
feat: user util
|
97
|
return CupertinoPageRoute(builder: (_) => const RepeatAfterPage());
|
22b7d4da
Key
feat: user, api path
|
98
|
case AppRouteName.user:
|
94342c3f
Key
feat: user util
|
99
|
return CupertinoPageRoute(builder: (_) => const UserPage());
|
da82bd70
Key
feat: user_inform...
|
100
101
|
case AppRouteName.userInformation:
return CupertinoPageRoute(builder: (_) => const UserInformationPage());
|
c9df43c8
Key
feat: 修改个人信息、接口
|
102
103
104
105
106
107
108
109
|
/*case AppRouteName.userModifyInformation:
return CupertinoPageRoute(builder: (_) {
ModifyUserInformationType argument = ModifyUserInformationType.name;
if (settings.arguments != null) {
argument = settings.arguments as ModifyUserInformationType;
}
return ModifyUserInformationPage(type: argument);
});*/
|
624214d0
liangchengyou
feat:看题选字/选图UI和部分逻辑
|
110
|
case AppRouteName.topicPic:
|
608c05b4
liangchengyou
feat:兑换课程
|
111
112
113
114
115
|
var courseLessonId = '';
if (settings.arguments != null) {
courseLessonId = (settings.arguments as Map)['courseLessonId'] as String??'';
}
return CupertinoPageRoute(builder: (_) => TopicPicturePage(courseLessonId: courseLessonId));
|
119ba920
liangchengyou
feat:视频播放器
|
116
|
case AppRouteName.lookVideo:
|
993c1a04
liangchengyou
feat:添加数据模型
|
117
|
final videoUrl = (settings.arguments as Map)['videoUrl'] as String;
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
118
|
final title = (settings.arguments as Map)['title'] as String?;
|
c61b3c1a
Key
feat: toast_util....
|
119
120
121
122
123
|
return CupertinoPageRoute(
builder: (_) => LookVideoPage(
videoUrl: videoUrl,
typeTitle: title,
));
|
c9df43c8
Key
feat: 修改个人信息、接口
|
124
|
/*case AppRouteName.setPwd:
|
c61b3c1a
Key
feat: toast_util....
|
125
126
127
128
129
130
131
132
133
|
var map = settings.arguments as Map;
final phoneNum = map['phoneNumber'] as String?;
final smsCode = map['smsCode'] as String?;
final pageType = map['pageType'] as SetPwdPageType;
return CupertinoPageRoute(
builder: (_) => SetPassWordPage(
phoneNum: phoneNum,
smsCode: smsCode,
pageType: pageType,
|
c9df43c8
Key
feat: 修改个人信息、接口
|
134
|
));*/
|
bfb40cd0
liangchengyou
feat:忘记密码获取验证码
|
135
136
137
|
case AppRouteName.webView:
final urlStr = (settings.arguments as Map)['urlStr'] as String;
final webViewTitle = (settings.arguments as Map)['webViewTitle'] as String;
|
94342c3f
Key
feat: user util
|
138
139
140
141
142
|
return CupertinoPageRoute(
builder: (_) => WowWebViewPage(
urlStr: urlStr,
webViewTitle: webViewTitle,
));
|
08a0f5a8
liangchengyou
feat:路由方式更新
|
143
144
145
|
case AppRouteName.readAfterContent:
return CupertinoPageRoute(
builder: (_) => const RepeatAfterContentPage());
|
2a29701f
liangchengyou
feat:提交代码
|
146
147
148
149
150
|
case AppRouteName.tab:
return PageRouteBuilder(
opaque: false,
settings: const RouteSettings(name: AppRouteName.tab),
transitionDuration: Duration.zero,
|
94342c3f
Key
feat: user util
|
151
|
pageBuilder: (_, __, ___) => const TabPage(),
|
2a29701f
liangchengyou
feat:提交代码
|
152
|
transitionsBuilder: (_, __, ___, child) => child);
|
2a427e12
吴启风
feat:绘本静态ui基本完成
|
153
|
case AppRouteName.reading:
|
53e9e6db
吴启风
feat:绘本语音评测逻辑
|
154
155
156
157
158
|
var courseLessonId = '';
if (settings.arguments != null) {
courseLessonId = (settings.arguments as Map)['courseLessonId'] as String??'';
}
return CupertinoPageRoute(builder: (_) => ReadingPage(courseLessonId: courseLessonId));
|
2a29701f
liangchengyou
feat:提交代码
|
159
160
|
default:
return CupertinoPageRoute(
|
94342c3f
Key
feat: user util
|
161
|
builder: (_) => Scaffold(body: Center(child: Text('No route defined for ${settings.name}'))));
|
2a29701f
liangchengyou
feat:提交代码
|
162
163
|
}
}
|
22b7d4da
Key
feat: user, api path
|
164
|
}
|
08a0f5a8
liangchengyou
feat:路由方式更新
|
165
166
167
168
169
170
171
172
173
174
175
176
|
void pushNamed(String routeName, {Object? arguments}) {
Navigator.of(AppRouter.context).pushNamed(routeName,arguments: arguments);
}
void pushNamedAndRemoveUntil(String routeName,RoutePredicate predicate, {Object? arguments}) {
Navigator.of(AppRouter.context).pushNamedAndRemoveUntil(routeName, predicate,arguments: arguments);
}
void popPage() {
Navigator.pop(AppRouter.context);
}
|