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';
|
578f1729
吴启风
fix:修复老bug:修改密码后跳...
|
5
|
import 'package:wow_english/generated/json/base/json_convert_content.dart';
|
2187c85f
吴启风
feat:课程结构调整
|
6
|
import 'package:wow_english/models/course_unit_entity.dart';
|
07599105
吴启风
feat:商品列表请求&路由
|
7
|
import 'package:wow_english/models/product_entity.dart';
|
6d61919a
吴启风
feat:增加过渡页&集成串联游戏
|
8
|
import 'package:wow_english/pages/games/view.dart';
|
2187c85f
吴启风
feat:课程结构调整
|
9
|
import 'package:wow_english/pages/home/view.dart';
|
4b358e22
liangchengyou
feat:调整文件结构
|
10
11
12
13
|
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';
|
5b87e560
吴启风
feat:导航栏视觉优化
|
14
|
import 'package:wow_english/pages/module/course_module_page.dart';
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
15
|
import 'package:wow_english/pages/practice/topic_picture_page.dart';
|
4b358e22
liangchengyou
feat:调整文件结构
|
16
|
import 'package:wow_english/pages/repeatafter/repeat_after_page.dart';
|
08a0f5a8
liangchengyou
feat:路由方式更新
|
17
|
import 'package:wow_english/pages/repeataftercontent/repeat_after_content_page.dart';
|
4b358e22
liangchengyou
feat:调整文件结构
|
18
19
|
import 'package:wow_english/pages/shop/exchane/exchange_lesson_page.dart';
import 'package:wow_english/pages/shop/exchangelist/exchange_lesson_list_page.dart';
|
fc3c67bf
吴启风
feat:新增购前须知页
|
20
|
import 'package:wow_english/pages/shop/home/shop_desc_page.dart';
|
4b358e22
liangchengyou
feat:调整文件结构
|
21
|
import 'package:wow_english/pages/shop/home/shop_home_page.dart';
|
da82bd70
Key
feat: user_inform...
|
22
|
import 'package:wow_english/pages/user/information/user_information_page.dart';
|
c948a9ea
liangchengyou
feat:个人信息更改模块功能
|
23
|
import 'package:wow_english/pages/user/modify/modify_user_avatar_page.dart';
|
c9df43c8
Key
feat: 修改个人信息、接口
|
24
|
import 'package:wow_english/pages/user/modify/modify_user_information_page.dart';
|
3840b7fe
liangchengyou
feat:更新设置页面
|
25
|
import 'package:wow_english/pages/user/setting/setting_page.dart';
|
4b358e22
liangchengyou
feat:调整文件结构
|
26
27
|
import 'package:wow_english/pages/user/user_page.dart';
import 'package:wow_english/pages/video/lookvideo/look_video_page.dart';
|
4b358e22
liangchengyou
feat:调整文件结构
|
28
|
|
2a3621f8
吴启风
feat:课程层级调整(增加unit层)
|
29
|
import '../models/course_module_entity.dart';
|
2a427e12
吴启风
feat:绘本静态ui基本完成
|
30
|
import '../pages/reading/reading_page.dart';
|
2187c85f
吴启风
feat:课程结构调整
|
31
|
import '../pages/section/section_page.dart';
|
4224b3f8
吴启风
feat:支付详情页ui
|
32
|
import '../pages/shopping/view.dart';
|
2187c85f
吴启风
feat:课程结构调整
|
33
|
import '../pages/tab/tab_page.dart';
|
2a3621f8
吴启风
feat:课程层级调整(增加unit层)
|
34
|
import '../pages/unit/view.dart';
|
3840b7fe
liangchengyou
feat:更新设置页面
|
35
36
|
import '../pages/user/setting/delete_account_page.dart';
import '../pages/user/setting/reback_page.dart';
|
2a427e12
吴启风
feat:绘本静态ui基本完成
|
37
|
|
2a29701f
liangchengyou
feat:提交代码
|
38
39
40
|
class AppRouteName {
static const String splash = 'splash';
static const String login = 'login';
|
95edef4f
liangchengyou
feat:更新适配代码
|
41
|
static const String home = 'home';
|
2187c85f
吴启风
feat:课程结构调整
|
42
|
static const String games = 'games';
|
4bf67b91
liangchengyou
feat:设置密码
|
43
|
static const String fogPwd = 'fogPwd';
|
c61b3c1a
Key
feat: toast_util....
|
44
|
|
c9df43c8
Key
feat: 修改个人信息、接口
|
45
46
|
/// 设置密码,修改密码;不要自己调用,使用[SetPassWordPage.push]方法,隐藏这种实现
//static const String setPwd = 'setPwd';
|
bfb40cd0
liangchengyou
feat:忘记密码获取验证码
|
47
|
static const String webView = 'webView';
|
2187c85f
吴启风
feat:课程结构调整
|
48
49
50
|
static const String courseModule = 'courseModules';
static const String courseUnit = 'courseUnits';
static const String courseSection = 'courseSections';
|
d35a4e87
liangchengyou
feat:磨耳朵功能UI
|
51
|
static const String listen = 'listen';
|
d1d32220
liangchengyou
feat:兑换课程+购买记录
|
52
|
static const String shop = 'shop';
|
fc3c67bf
吴启风
feat:新增购前须知页
|
53
|
static const String shopDesc = 'shopDesc';
|
d1d32220
liangchengyou
feat:兑换课程+购买记录
|
54
55
|
static const String exLesson = 'exLesson';
static const String exList = 'exList';
|
9d080046
liangchengyou
feat:视频跟读逻辑
|
56
|
static const String reAfter = 'reAfter';
|
624214d0
liangchengyou
feat:看题选字/选图UI和部分逻辑
|
57
|
static const String topicPic = 'topicPic';
|
22b7d4da
Key
feat: user, api path
|
58
|
static const String user = 'user';
|
4224b3f8
吴启风
feat:支付详情页ui
|
59
|
static const String pay = 'pay';
|
da82bd70
Key
feat: user_inform...
|
60
61
62
|
/// 用户详细信息页
static const String userInformation = 'userInformation';
|
2187c85f
吴启风
feat:课程结构调整
|
63
|
|
c948a9ea
liangchengyou
feat:个人信息更改模块功能
|
64
65
|
/// 修改用户头像
static const String userAvatar = 'userAvatar';
|
c9df43c8
Key
feat: 修改个人信息、接口
|
66
67
68
|
/// 用户修改信息页,不要自己调用,使用[ModifyUserInformationPage.push]方法,隐藏这种实现
//static const String userModifyInformation = 'userModifyInformation';
|
08a0f5a8
liangchengyou
feat:路由方式更新
|
69
|
///看视频
|
119ba920
liangchengyou
feat:视频播放器
|
70
|
static const String lookVideo = 'lookVideo';
|
2187c85f
吴启风
feat:课程结构调整
|
71
|
|
08a0f5a8
liangchengyou
feat:路由方式更新
|
72
|
///绘本
|
c61b3c1a
Key
feat: toast_util....
|
73
|
static const String reading = 'reading';
|
2187c85f
吴启风
feat:课程结构调整
|
74
|
|
08a0f5a8
liangchengyou
feat:路由方式更新
|
75
76
77
|
///视频跟读详情
static const String readAfterContent = 'readAfterContent';
|
3840b7fe
liangchengyou
feat:更新设置页面
|
78
79
|
///设置
static const String setting = 'setting';
|
2187c85f
吴启风
feat:课程结构调整
|
80
|
|
3840b7fe
liangchengyou
feat:更新设置页面
|
81
82
|
///注销账号
static const String deleteAccount = 'deleteAccount';
|
2187c85f
吴启风
feat:课程结构调整
|
83
|
|
3840b7fe
liangchengyou
feat:更新设置页面
|
84
85
86
|
///帮助与反馈
static const String reBack = 'reBack';
|
2a29701f
liangchengyou
feat:提交代码
|
87
88
89
90
91
|
static const String tab = '/';
}
class AppRouter {
static final navigatorKey = GlobalKey<NavigatorState>();
|
94342c3f
Key
feat: user util
|
92
|
|
2a29701f
liangchengyou
feat:提交代码
|
93
94
|
// App 根节点Context
static BuildContext get context => navigatorKey.currentContext!;
|
22b7d4da
Key
feat: user, api path
|
95
|
|
2a29701f
liangchengyou
feat:提交代码
|
96
97
98
99
100
|
static Route<dynamic> generateRoute(RouteSettings settings) {
switch (settings.name) {
case AppRouteName.splash:
return PageRouteBuilder(
opaque: false,
|
94342c3f
Key
feat: user util
|
101
|
pageBuilder: (_, __, ___) => const SplashPage(),
|
2a29701f
liangchengyou
feat:提交代码
|
102
103
104
|
transitionDuration: Duration.zero,
transitionsBuilder: (_, __, ___, child) => child);
case AppRouteName.login:
|
578f1729
吴启风
fix:修复老bug:修改密码后跳...
|
105
|
// 是否默认密码登录,修改密码后跳登录页,优先密码登录体验好点
|
2187c85f
吴启风
feat:课程结构调整
|
106
107
108
109
110
111
112
113
|
final bool showPasswordPage = (settings.arguments as Map?)
?.getOrNull('showPasswordPage') as bool? ??
false;
return CupertinoPageRoute(
builder: (_) =>
LoginPage(preferencesPasswordLogin: showPasswordPage));
case AppRouteName.home:
return CupertinoPageRoute(builder: (_) => const HomePage());
|
6d61919a
吴启风
feat:增加过渡页&集成串联游戏
|
114
115
|
case AppRouteName.games:
return CupertinoPageRoute(builder: (_) => const GamesPage());
|
2187c85f
吴启风
feat:课程结构调整
|
116
117
118
119
|
case AppRouteName.fogPwd:
return CupertinoPageRoute(
builder: (_) => const ForgetPasswordHomePage());
case AppRouteName.courseModule:
|
5b87e560
吴启风
feat:导航栏视觉优化
|
120
|
return CupertinoPageRoute(builder: (_) => const CourseModulePage());
|
2187c85f
吴启风
feat:课程结构调整
|
121
122
|
case AppRouteName.courseUnit:
CourseModuleEntity courseModuleEntity = CourseModuleEntity();
|
8988aa69
liangchengyou
feat:首页+课程列表数据获取
|
123
|
if (settings.arguments != null) {
|
2187c85f
吴启风
feat:课程结构调整
|
124
125
|
courseModuleEntity = (settings.arguments as Map)
.getOrNull('courseModuleEntity') as CourseModuleEntity;
|
8988aa69
liangchengyou
feat:首页+课程列表数据获取
|
126
|
}
|
c61b3c1a
Key
feat: toast_util....
|
127
|
return CupertinoPageRoute(
|
2187c85f
吴启风
feat:课程结构调整
|
128
129
130
|
builder: (_) => UnitPage(courseModuleEntity: courseModuleEntity));
case AppRouteName.courseSection:
CourseUnitEntity courseUnitEntity = CourseUnitEntity();
|
66a7e3e7
吴启风
feat:退出课堂和结束课堂优化
|
131
|
int courseUnitDetail = 0;
|
2a3621f8
吴启风
feat:课程层级调整(增加unit层)
|
132
|
if (settings.arguments != null) {
|
2187c85f
吴启风
feat:课程结构调整
|
133
134
135
|
courseUnitEntity = (settings.arguments as Map)
.getOrNull('courseUnitEntity') as CourseUnitEntity;
courseUnitDetail = (settings.arguments as Map)
|
66a7e3e7
吴启风
feat:退出课堂和结束课堂优化
|
136
|
.getOrNull('courseUnitId');
|
2a3621f8
吴启风
feat:课程层级调整(增加unit层)
|
137
|
}
|
2187c85f
吴启风
feat:课程结构调整
|
138
139
140
|
return CupertinoPageRoute(
builder: (_) => SectionPage(
courseUnitEntity: courseUnitEntity,
|
66a7e3e7
吴启风
feat:退出课堂和结束课堂优化
|
141
|
courseUnitId: courseUnitDetail));
|
d35a4e87
liangchengyou
feat:磨耳朵功能UI
|
142
|
case AppRouteName.listen:
|
94342c3f
Key
feat: user util
|
143
|
return CupertinoPageRoute(builder: (_) => const ListenPage());
|
d1d32220
liangchengyou
feat:兑换课程+购买记录
|
144
|
case AppRouteName.shop:
|
94342c3f
Key
feat: user util
|
145
|
return CupertinoPageRoute(builder: (_) => const ShopHomePage());
|
fc3c67bf
吴启风
feat:新增购前须知页
|
146
147
|
case AppRouteName.shopDesc:
return CupertinoPageRoute(builder: (_) => const ShopDescPage());
|
4224b3f8
吴启风
feat:支付详情页ui
|
148
|
case AppRouteName.pay:
|
07599105
吴启风
feat:商品列表请求&路由
|
149
150
151
152
|
var productEntity = ProductEntity();
if (settings.arguments != null && settings.arguments is ProductEntity) {
productEntity = settings.arguments as ProductEntity;
}
|
2187c85f
吴启风
feat:课程结构调整
|
153
154
|
return CupertinoPageRoute(
builder: (_) => ShoppingPage(productEntity: productEntity));
|
d1d32220
liangchengyou
feat:兑换课程+购买记录
|
155
|
case AppRouteName.exLesson:
|
94342c3f
Key
feat: user util
|
156
|
return CupertinoPageRoute(builder: (_) => const ExchangeLessonPage());
|
d1d32220
liangchengyou
feat:兑换课程+购买记录
|
157
|
case AppRouteName.exList:
|
2187c85f
吴启风
feat:课程结构调整
|
158
159
|
return CupertinoPageRoute(
builder: (_) => const ExchangeLessonListPage());
|
9d080046
liangchengyou
feat:视频跟读逻辑
|
160
|
case AppRouteName.reAfter:
|
94342c3f
Key
feat: user util
|
161
|
return CupertinoPageRoute(builder: (_) => const RepeatAfterPage());
|
22b7d4da
Key
feat: user, api path
|
162
|
case AppRouteName.user:
|
94342c3f
Key
feat: user util
|
163
|
return CupertinoPageRoute(builder: (_) => const UserPage());
|
da82bd70
Key
feat: user_inform...
|
164
165
|
case AppRouteName.userInformation:
return CupertinoPageRoute(builder: (_) => const UserInformationPage());
|
c948a9ea
liangchengyou
feat:个人信息更改模块功能
|
166
167
168
|
case AppRouteName.userAvatar:
var pageType = 0;
if (settings.arguments != null) {
|
934e2b47
liangchengyou
feat:权限调整+课程进度接口对接
|
169
|
final content = (settings.arguments as Map)['pageType'] as String;
|
c948a9ea
liangchengyou
feat:个人信息更改模块功能
|
170
171
|
pageType = int.parse(content);
}
|
e55bbdf3
Key
fixed: aliyun oss...
|
172
173
174
175
176
|
return CupertinoPageRoute(
builder: (_) => ModifyUserAvatarPage(
pageType: pageType,
));
/*case AppRouteName.userModifyInformation:
|
c9df43c8
Key
feat: 修改个人信息、接口
|
177
178
179
180
181
182
183
|
return CupertinoPageRoute(builder: (_) {
ModifyUserInformationType argument = ModifyUserInformationType.name;
if (settings.arguments != null) {
argument = settings.arguments as ModifyUserInformationType;
}
return ModifyUserInformationPage(type: argument);
});*/
|
624214d0
liangchengyou
feat:看题选字/选图UI和部分逻辑
|
184
|
case AppRouteName.topicPic:
|
608c05b4
liangchengyou
feat:兑换课程
|
185
186
|
var courseLessonId = '';
if (settings.arguments != null) {
|
2187c85f
吴启风
feat:课程结构调整
|
187
188
|
courseLessonId =
(settings.arguments as Map)['courseLessonId'] as String;
|
608c05b4
liangchengyou
feat:兑换课程
|
189
|
}
|
2187c85f
吴启风
feat:课程结构调整
|
190
191
|
return CupertinoPageRoute(
builder: (_) => TopicPicturePage(courseLessonId: courseLessonId));
|
119ba920
liangchengyou
feat:视频播放器
|
192
|
case AppRouteName.lookVideo:
|
993c1a04
liangchengyou
feat:添加数据模型
|
193
|
final videoUrl = (settings.arguments as Map)['videoUrl'] as String;
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
194
|
final title = (settings.arguments as Map)['title'] as String?;
|
2187c85f
吴启风
feat:课程结构调整
|
195
196
|
final courseLessonId =
(settings.arguments as Map)['courseLessonId'] as String?;
|
46675a89
吴启风
feat:过渡页-视频环节
|
197
198
|
///是否是课程内的视频环节,用于播放结束判断要不要再来一次以及下一环节用
final isTopic = (settings.arguments as Map)['isTopic'] as bool? ?? false;
|
c61b3c1a
Key
feat: toast_util....
|
199
200
|
return CupertinoPageRoute(
builder: (_) => LookVideoPage(
|
2187c85f
吴启风
feat:课程结构调整
|
201
202
203
|
videoUrl: videoUrl,
typeTitle: title,
courseLessonId: courseLessonId,
|
46675a89
吴启风
feat:过渡页-视频环节
|
204
|
isTopic: isTopic,
|
2187c85f
吴启风
feat:课程结构调整
|
205
|
));
|
e55bbdf3
Key
fixed: aliyun oss...
|
206
|
/*case AppRouteName.setPwd:
|
cb38bc90
liangchengyou
feat:视频跟读逻辑处理
|
207
|
case AppRouteName.setPwd:
|
c61b3c1a
Key
feat: toast_util....
|
208
209
210
|
phoneNum: phoneNum,
smsCode: smsCode,
pageType: pageType,
|
c9df43c8
Key
feat: 修改个人信息、接口
|
211
|
));*/
|
bfb40cd0
liangchengyou
feat:忘记密码获取验证码
|
212
213
|
case AppRouteName.webView:
final urlStr = (settings.arguments as Map)['urlStr'] as String;
|
2187c85f
吴启风
feat:课程结构调整
|
214
215
|
final webViewTitle =
(settings.arguments as Map)['webViewTitle'] as String;
|
94342c3f
Key
feat: user util
|
216
217
|
return CupertinoPageRoute(
builder: (_) => WowWebViewPage(
|
e55bbdf3
Key
fixed: aliyun oss...
|
218
219
220
|
urlStr: urlStr,
webViewTitle: webViewTitle,
));
|
08a0f5a8
liangchengyou
feat:路由方式更新
|
221
|
case AppRouteName.readAfterContent:
|
cb38bc90
liangchengyou
feat:视频跟读逻辑处理
|
222
223
|
var videoFollowReadId = '';
if (settings.arguments != null) {
|
2187c85f
吴启风
feat:课程结构调整
|
224
225
|
videoFollowReadId =
(settings.arguments as Map)['videoFollowReadId'] as String;
|
cb38bc90
liangchengyou
feat:视频跟读逻辑处理
|
226
|
}
|
2187c85f
吴启风
feat:课程结构调整
|
227
228
229
|
return CupertinoPageRoute(
builder: (_) =>
RepeatAfterContentPage(videoFollowReadId: videoFollowReadId));
|
3840b7fe
liangchengyou
feat:更新设置页面
|
230
|
case AppRouteName.setting:
|
2187c85f
吴启风
feat:课程结构调整
|
231
|
return CupertinoPageRoute(builder: (_) => const SettingPage());
|
3840b7fe
liangchengyou
feat:更新设置页面
|
232
|
case AppRouteName.deleteAccount:
|
2187c85f
吴启风
feat:课程结构调整
|
233
|
return CupertinoPageRoute(builder: (_) => const DeleteAccountPage());
|
3840b7fe
liangchengyou
feat:更新设置页面
|
234
235
|
case AppRouteName.reBack:
return CupertinoPageRoute(builder: (_) => const ReBackPage());
|
2a29701f
liangchengyou
feat:提交代码
|
236
237
238
239
240
|
case AppRouteName.tab:
return PageRouteBuilder(
opaque: false,
settings: const RouteSettings(name: AppRouteName.tab),
transitionDuration: Duration.zero,
|
94342c3f
Key
feat: user util
|
241
|
pageBuilder: (_, __, ___) => const TabPage(),
|
2a29701f
liangchengyou
feat:提交代码
|
242
|
transitionsBuilder: (_, __, ___, child) => child);
|
2a427e12
吴启风
feat:绘本静态ui基本完成
|
243
|
case AppRouteName.reading:
|
53e9e6db
吴启风
feat:绘本语音评测逻辑
|
244
245
|
var courseLessonId = '';
if (settings.arguments != null) {
|
2187c85f
吴启风
feat:课程结构调整
|
246
247
|
courseLessonId =
(settings.arguments as Map)['courseLessonId'] as String;
|
53e9e6db
吴启风
feat:绘本语音评测逻辑
|
248
|
}
|
2187c85f
吴启风
feat:课程结构调整
|
249
250
|
return CupertinoPageRoute(
builder: (_) => ReadingPage(courseLessonId: courseLessonId));
|
2a29701f
liangchengyou
feat:提交代码
|
251
252
|
default:
return CupertinoPageRoute(
|
2187c85f
吴启风
feat:课程结构调整
|
253
254
255
|
builder: (_) => Scaffold(
body: Center(
child: Text('No route defined for ${settings.name}'))));
|
2a29701f
liangchengyou
feat:提交代码
|
256
257
|
}
}
|
22b7d4da
Key
feat: user, api path
|
258
|
}
|
08a0f5a8
liangchengyou
feat:路由方式更新
|
259
|
|
934e2b47
liangchengyou
feat:权限调整+课程进度接口对接
|
260
|
Future pushNamed(String routeName, {Object? arguments}) {
|
2187c85f
吴启风
feat:课程结构调整
|
261
262
263
|
return Navigator.of(AppRouter.context)
.pushNamed(routeName, arguments: arguments)
.then((value) {
|
934e2b47
liangchengyou
feat:权限调整+课程进度接口对接
|
264
265
|
return value;
});
|
08a0f5a8
liangchengyou
feat:路由方式更新
|
266
267
|
}
|
2187c85f
吴启风
feat:课程结构调整
|
268
269
270
271
|
Future pushNamedAndRemoveUntil(String routeName, RoutePredicate predicate,
{Object? arguments}) {
return Navigator.of(AppRouter.context)
.pushNamedAndRemoveUntil(routeName, predicate, arguments: arguments);
|
08a0f5a8
liangchengyou
feat:路由方式更新
|
272
273
|
}
|
934e2b47
liangchengyou
feat:权限调整+课程进度接口对接
|
274
|
void popPage({dynamic data}) {
|
2187c85f
吴启风
feat:课程结构调整
|
275
|
Navigator.of(AppRouter.context).pop(data);
|
08a0f5a8
liangchengyou
feat:路由方式更新
|
276
|
}
|