Commit 22b7d4da737cd287f8a313069243e2fbef15b1f8
1 parent
119ba920
feat: user, api path
Showing
11 changed files
with
85 additions
and
18 deletions
android/app/build.gradle
... | ... | @@ -26,7 +26,7 @@ apply plugin: 'kotlin-android' |
26 | 26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" |
27 | 27 | |
28 | 28 | android { |
29 | - namespace "com.kouyuxingqiu.wowenglish" | |
29 | + namespace "com.kouyuxingqiu.wow_english" | |
30 | 30 | // compileSdkVersion flutter.compileSdkVersion |
31 | 31 | compileSdkVersion 33 |
32 | 32 | // 展示没有ndk需求 |
... | ... | @@ -46,7 +46,7 @@ android { |
46 | 46 | } |
47 | 47 | |
48 | 48 | defaultConfig { |
49 | - applicationId "com.kouyuxingqiu.wowenglish" | |
49 | + applicationId "com.kouyuxingqiu.wow_english" | |
50 | 50 | //minSdkVersion flutter.minSdkVersion |
51 | 51 | //targetSdkVersion flutter.targetSdkVersion |
52 | 52 | minSdkVersion 23 | ... | ... |
android/app/src/main/kotlin/com/kouyuxingqiu/wow_english/MainActivity.kt
lib/common/extension/string_extension.dart
1 | -const String _assetImagePrefix = "assets/images/"; | |
2 | - | |
3 | 1 | /// 资源类扩展方法 |
4 | 2 | extension AssetExtension on String { |
3 | + static const String _assetImagePrefix = "assets/images/"; | |
4 | + | |
5 | 5 | /// 图片url |
6 | 6 | String get assetImg => _assetImagePrefix + this; |
7 | - String get assetPng => 'assets/images/$this.png'; | |
8 | - String get assetGif => 'assets/images/$this.gif'; | |
7 | + | |
8 | + String get assetPng => '$assetImg.png'; | |
9 | + | |
10 | + String get assetGif => '$assetImg.gif'; | |
9 | 11 | } | ... | ... |
lib/login/loginpage/bloc/login_state.dart
lib/network/api.dart
1 | 1 | class Api { |
2 | - static const String testApi = 'home/courseLesson'; | |
3 | -} | |
4 | 2 | \ No newline at end of file |
3 | + /// app初始化配置信息 | |
4 | + // GET /system/app/config | |
5 | + // 接口地址:https://app.apifox.com/link/project/2684751/apis/api-89897678 | |
6 | + static const String appConfig = '/system/app/config'; | |
7 | + | |
8 | + /// 登陆 | |
9 | + static const String login = 'login'; | |
10 | + | |
11 | + /// 登出 | |
12 | + static const String logout = 'logout'; | |
13 | + | |
14 | + /// 发送验证码 | |
15 | + static const String sendSmsCode = '/system/send/code'; | |
16 | + | |
17 | + /// 课程模块 | |
18 | + // GET /home/courseModule | |
19 | + // 接口地址:https://app.apifox.com/link/project/2684751/apis/api-89897663 | |
20 | + static const String courseModule = '/home/courseModule'; | |
21 | + | |
22 | + /// 课程列表 | |
23 | + // GET /home/courseLesson | |
24 | + // 接口地址:https://app.apifox.com/link/project/2684751/apis/api-89897662 | |
25 | + static const String courseLesson = '/home/courseLesson'; | |
26 | +} | ... | ... |
lib/network/basic_configuration.dart
1 | 1 | enum DevelopEvent { |
2 | 2 | ///开发环境 |
3 | 3 | dev, |
4 | - ///测试环境 | |
5 | - test, | |
6 | 4 | ///正式环境 |
7 | 5 | formal |
8 | 6 | } |
... | ... | @@ -19,9 +17,7 @@ class BasicConfigurationManager { |
19 | 17 | |
20 | 18 | BasicConfigurationManager._internal(){ |
21 | 19 | DevelopEvent developType = DevelopEvent.dev; |
22 | - if (developType == DevelopEvent.test) { | |
23 | - baseUrl = 'http://wow-app.dev.kouyuxingqiu.com'; | |
24 | - } else if(developType == DevelopEvent.dev) { | |
20 | + if(developType == DevelopEvent.dev) { | |
25 | 21 | baseUrl = 'http://wow-app.dev.kouyuxingqiu.com'; |
26 | 22 | } else { |
27 | 23 | baseUrl = 'http://wow-app.dev.kouyuxingqiu.com'; |
... | ... | @@ -33,4 +29,4 @@ class BasicConfigurationManager { |
33 | 29 | _instance ??= BasicConfigurationManager._internal(); |
34 | 30 | return _instance!; |
35 | 31 | } |
36 | -} | |
37 | 32 | \ No newline at end of file |
33 | +} | ... | ... |
lib/route/route.dart
... | ... | @@ -15,6 +15,7 @@ import 'package:wow_english/shop/exchane/exchange_lesson_page.dart'; |
15 | 15 | import 'package:wow_english/shop/exchangelist/exchange_lesson_list_page.dart'; |
16 | 16 | import 'package:wow_english/shop/home/shop_home_page.dart'; |
17 | 17 | import 'package:wow_english/tab/tab_page.dart'; |
18 | +import 'package:wow_english/user/user_page.dart'; | |
18 | 19 | import 'package:wow_english/video/lookvideo/look_video_page.dart'; |
19 | 20 | |
20 | 21 | |
... | ... | @@ -33,6 +34,7 @@ class AppRouteName { |
33 | 34 | static const String reAfter = 'reAfter'; |
34 | 35 | static const String topicPic = 'topicPic'; |
35 | 36 | static const String topicWord = 'topicWord'; |
37 | + static const String user = 'user'; | |
36 | 38 | static const String lookVideo = 'lookVideo'; |
37 | 39 | static const String tab = '/'; |
38 | 40 | } |
... | ... | @@ -41,7 +43,7 @@ class AppRouter { |
41 | 43 | static final navigatorKey = GlobalKey<NavigatorState>(); |
42 | 44 | // App 根节点Context |
43 | 45 | static BuildContext get context => navigatorKey.currentContext!; |
44 | - | |
46 | + | |
45 | 47 | static Route<dynamic> generateRoute(RouteSettings settings) { |
46 | 48 | switch (settings.name) { |
47 | 49 | case AppRouteName.splash: |
... | ... | @@ -68,6 +70,8 @@ class AppRouter { |
68 | 70 | return CupertinoPageRoute(builder: (_) => const ExchangeLessonListPage()); |
69 | 71 | case AppRouteName.reAfter: |
70 | 72 | return CupertinoPageRoute(builder: (_) => const RepeatAfterPage()); |
73 | + case AppRouteName.user: | |
74 | + return CupertinoPageRoute(builder: (_) => const UserPage()); | |
71 | 75 | case AppRouteName.topicPic: |
72 | 76 | return CupertinoPageRoute(builder: (_) => const TopicPicturePage()); |
73 | 77 | case AppRouteName.topicWord: |
... | ... | @@ -95,4 +99,4 @@ class AppRouter { |
95 | 99 | child: Text('No route defined for ${settings.name}')))); |
96 | 100 | } |
97 | 101 | } |
98 | -} | |
99 | 102 | \ No newline at end of file |
103 | +} | ... | ... |
lib/user/bloc/user_bloc.dart
0 → 100644
1 | +import 'package:bloc/bloc.dart'; | |
2 | +import 'package:meta/meta.dart'; | |
3 | + | |
4 | +part 'user_event.dart'; | |
5 | +part 'user_state.dart'; | |
6 | + | |
7 | +class UserBloc extends Bloc<UserEvent, UserState> { | |
8 | + UserBloc() : super(UserInitial()) { | |
9 | + on<UserEvent>((event, emit) { | |
10 | + // TODO: implement event handler | |
11 | + }); | |
12 | + } | |
13 | +} | ... | ... |
lib/user/bloc/user_event.dart
0 → 100644
lib/user/bloc/user_state.dart
0 → 100644
lib/user/user_page.dart
0 → 100644
1 | +import 'package:flutter/material.dart'; | |
2 | + | |
3 | +import '../common/widgets/we_app_bar.dart'; | |
4 | + | |
5 | +class UserPage extends StatelessWidget { | |
6 | + const UserPage({super.key}); | |
7 | + | |
8 | + @override | |
9 | + Widget build(BuildContext context) { | |
10 | + return Scaffold( | |
11 | + backgroundColor: Colors.white, | |
12 | + appBar: WEAppBar( | |
13 | + titleText: '1', | |
14 | + ), | |
15 | + body: Row(), | |
16 | + ); | |
17 | + } | |
18 | +} | ... | ... |