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';
|
95edef4f
liangchengyou
feat:更新适配代码
|
5
|
import 'package:wow_english/home/home_page.dart';
|
1d5315dd
liangchengyou
feat:添加字体,调整文件结构
|
6
7
8
|
import 'package:wow_english/login/forgetpwd/forget_password_home_page.dart';
import 'package:wow_english/login/loginpage/login_page.dart';
import 'package:wow_english/login/setpwd/set_pwd_page.dart';
|
2a29701f
liangchengyou
feat:提交代码
|
9
10
11
12
13
14
|
import 'package:wow_english/tab/tab_page.dart';
class AppRouteName {
static const String splash = 'splash';
static const String login = 'login';
|
95edef4f
liangchengyou
feat:更新适配代码
|
15
|
static const String home = 'home';
|
4bf67b91
liangchengyou
feat:设置密码
|
16
|
static const String fogPwd = 'fogPwd';
|
1d5315dd
liangchengyou
feat:添加字体,调整文件结构
|
17
|
static const String setPwd = 'setPwd';
|
bfb40cd0
liangchengyou
feat:忘记密码获取验证码
|
18
|
static const String webView = 'webView';
|
2a29701f
liangchengyou
feat:提交代码
|
19
20
21
22
23
24
25
26
27
28
29
30
31
|
static const String tab = '/';
}
class AppRouter {
static final navigatorKey = GlobalKey<NavigatorState>();
// App 根节点Context
static BuildContext get context => navigatorKey.currentContext!;
static Route<dynamic> generateRoute(RouteSettings settings) {
switch (settings.name) {
case AppRouteName.splash:
return PageRouteBuilder(
opaque: false,
|
a117a5a3
liangchengyou
feat:更新代码
|
32
|
pageBuilder: (_,__,___) => const SplashPage(),
|
2a29701f
liangchengyou
feat:提交代码
|
33
34
35
|
transitionDuration: Duration.zero,
transitionsBuilder: (_, __, ___, child) => child);
case AppRouteName.login:
|
062f0df2
liangchengyou
feat:登录模块代码提交
|
36
|
return CupertinoPageRoute(builder: (_) => const LoginPage());
|
95edef4f
liangchengyou
feat:更新适配代码
|
37
38
|
case AppRouteName.home:
return CupertinoPageRoute(builder: (_) => const HomePage());
|
4bf67b91
liangchengyou
feat:设置密码
|
39
|
case AppRouteName.fogPwd:
|
1d5315dd
liangchengyou
feat:添加字体,调整文件结构
|
40
41
|
return CupertinoPageRoute(builder: (_) => const ForgetPasswordHomePage());
case AppRouteName.setPwd:
|
4bf67b91
liangchengyou
feat:设置密码
|
42
|
final phoneNum = (settings.arguments as Map)['phoneNumber'] as String;
|
1d5315dd
liangchengyou
feat:添加字体,调整文件结构
|
43
|
return CupertinoPageRoute(builder: (_) => SetPassWordPage(phoneNum: phoneNum));
|
bfb40cd0
liangchengyou
feat:忘记密码获取验证码
|
44
45
46
47
|
case AppRouteName.webView:
final urlStr = (settings.arguments as Map)['urlStr'] as String;
final webViewTitle = (settings.arguments as Map)['webViewTitle'] as String;
return CupertinoPageRoute(builder: (_) => WowWebViewPage(urlStr: urlStr,webViewTitle: webViewTitle,));
|
2a29701f
liangchengyou
feat:提交代码
|
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
case AppRouteName.tab:
return PageRouteBuilder(
opaque: false,
settings: const RouteSettings(name: AppRouteName.tab),
transitionDuration: Duration.zero,
pageBuilder: (_,__,___) => const TabPage(),
transitionsBuilder: (_, __, ___, child) => child);
default:
return CupertinoPageRoute(
builder: (_) => Scaffold(
body: Center(
child: Text('No route defined for ${settings.name}'))));
}
}
}
|