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,7 +26,7 @@ apply plugin: 'kotlin-android' | ||
26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" | 26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" |
27 | 27 | ||
28 | android { | 28 | android { |
29 | - namespace "com.kouyuxingqiu.wowenglish" | 29 | + namespace "com.kouyuxingqiu.wow_english" |
30 | // compileSdkVersion flutter.compileSdkVersion | 30 | // compileSdkVersion flutter.compileSdkVersion |
31 | compileSdkVersion 33 | 31 | compileSdkVersion 33 |
32 | // 展示没有ndk需求 | 32 | // 展示没有ndk需求 |
@@ -46,7 +46,7 @@ android { | @@ -46,7 +46,7 @@ android { | ||
46 | } | 46 | } |
47 | 47 | ||
48 | defaultConfig { | 48 | defaultConfig { |
49 | - applicationId "com.kouyuxingqiu.wowenglish" | 49 | + applicationId "com.kouyuxingqiu.wow_english" |
50 | //minSdkVersion flutter.minSdkVersion | 50 | //minSdkVersion flutter.minSdkVersion |
51 | //targetSdkVersion flutter.targetSdkVersion | 51 | //targetSdkVersion flutter.targetSdkVersion |
52 | minSdkVersion 23 | 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 | extension AssetExtension on String { | 2 | extension AssetExtension on String { |
3 | + static const String _assetImagePrefix = "assets/images/"; | ||
4 | + | ||
5 | /// 图片url | 5 | /// 图片url |
6 | String get assetImg => _assetImagePrefix + this; | 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
@@ -13,4 +13,6 @@ class SmsSendTypeChangeState extends LoginState {} | @@ -13,4 +13,6 @@ class SmsSendTypeChangeState extends LoginState {} | ||
13 | ///是否同意协议 | 13 | ///是否同意协议 |
14 | class AgreementTypeChangeState extends LoginState {} | 14 | class AgreementTypeChangeState extends LoginState {} |
15 | ///登陆请求结果 | 15 | ///登陆请求结果 |
16 | -class LoginResultChangeState extends LoginState {} | 16 | +class LoginResultChangeState extends LoginState { |
17 | + | ||
18 | +} |
lib/network/api.dart
1 | class Api { | 1 | class Api { |
2 | - static const String testApi = 'home/courseLesson'; | ||
3 | -} | ||
4 | \ No newline at end of file | 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 | enum DevelopEvent { | 1 | enum DevelopEvent { |
2 | ///开发环境 | 2 | ///开发环境 |
3 | dev, | 3 | dev, |
4 | - ///测试环境 | ||
5 | - test, | ||
6 | ///正式环境 | 4 | ///正式环境 |
7 | formal | 5 | formal |
8 | } | 6 | } |
@@ -19,9 +17,7 @@ class BasicConfigurationManager { | @@ -19,9 +17,7 @@ class BasicConfigurationManager { | ||
19 | 17 | ||
20 | BasicConfigurationManager._internal(){ | 18 | BasicConfigurationManager._internal(){ |
21 | DevelopEvent developType = DevelopEvent.dev; | 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 | baseUrl = 'http://wow-app.dev.kouyuxingqiu.com'; | 21 | baseUrl = 'http://wow-app.dev.kouyuxingqiu.com'; |
26 | } else { | 22 | } else { |
27 | baseUrl = 'http://wow-app.dev.kouyuxingqiu.com'; | 23 | baseUrl = 'http://wow-app.dev.kouyuxingqiu.com'; |
@@ -33,4 +29,4 @@ class BasicConfigurationManager { | @@ -33,4 +29,4 @@ class BasicConfigurationManager { | ||
33 | _instance ??= BasicConfigurationManager._internal(); | 29 | _instance ??= BasicConfigurationManager._internal(); |
34 | return _instance!; | 30 | return _instance!; |
35 | } | 31 | } |
36 | -} | ||
37 | \ No newline at end of file | 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,6 +15,7 @@ import 'package:wow_english/shop/exchane/exchange_lesson_page.dart'; | ||
15 | import 'package:wow_english/shop/exchangelist/exchange_lesson_list_page.dart'; | 15 | import 'package:wow_english/shop/exchangelist/exchange_lesson_list_page.dart'; |
16 | import 'package:wow_english/shop/home/shop_home_page.dart'; | 16 | import 'package:wow_english/shop/home/shop_home_page.dart'; |
17 | import 'package:wow_english/tab/tab_page.dart'; | 17 | import 'package:wow_english/tab/tab_page.dart'; |
18 | +import 'package:wow_english/user/user_page.dart'; | ||
18 | import 'package:wow_english/video/lookvideo/look_video_page.dart'; | 19 | import 'package:wow_english/video/lookvideo/look_video_page.dart'; |
19 | 20 | ||
20 | 21 | ||
@@ -33,6 +34,7 @@ class AppRouteName { | @@ -33,6 +34,7 @@ class AppRouteName { | ||
33 | static const String reAfter = 'reAfter'; | 34 | static const String reAfter = 'reAfter'; |
34 | static const String topicPic = 'topicPic'; | 35 | static const String topicPic = 'topicPic'; |
35 | static const String topicWord = 'topicWord'; | 36 | static const String topicWord = 'topicWord'; |
37 | + static const String user = 'user'; | ||
36 | static const String lookVideo = 'lookVideo'; | 38 | static const String lookVideo = 'lookVideo'; |
37 | static const String tab = '/'; | 39 | static const String tab = '/'; |
38 | } | 40 | } |
@@ -41,7 +43,7 @@ class AppRouter { | @@ -41,7 +43,7 @@ class AppRouter { | ||
41 | static final navigatorKey = GlobalKey<NavigatorState>(); | 43 | static final navigatorKey = GlobalKey<NavigatorState>(); |
42 | // App 根节点Context | 44 | // App 根节点Context |
43 | static BuildContext get context => navigatorKey.currentContext!; | 45 | static BuildContext get context => navigatorKey.currentContext!; |
44 | - | 46 | + |
45 | static Route<dynamic> generateRoute(RouteSettings settings) { | 47 | static Route<dynamic> generateRoute(RouteSettings settings) { |
46 | switch (settings.name) { | 48 | switch (settings.name) { |
47 | case AppRouteName.splash: | 49 | case AppRouteName.splash: |
@@ -68,6 +70,8 @@ class AppRouter { | @@ -68,6 +70,8 @@ class AppRouter { | ||
68 | return CupertinoPageRoute(builder: (_) => const ExchangeLessonListPage()); | 70 | return CupertinoPageRoute(builder: (_) => const ExchangeLessonListPage()); |
69 | case AppRouteName.reAfter: | 71 | case AppRouteName.reAfter: |
70 | return CupertinoPageRoute(builder: (_) => const RepeatAfterPage()); | 72 | return CupertinoPageRoute(builder: (_) => const RepeatAfterPage()); |
73 | + case AppRouteName.user: | ||
74 | + return CupertinoPageRoute(builder: (_) => const UserPage()); | ||
71 | case AppRouteName.topicPic: | 75 | case AppRouteName.topicPic: |
72 | return CupertinoPageRoute(builder: (_) => const TopicPicturePage()); | 76 | return CupertinoPageRoute(builder: (_) => const TopicPicturePage()); |
73 | case AppRouteName.topicWord: | 77 | case AppRouteName.topicWord: |
@@ -95,4 +99,4 @@ class AppRouter { | @@ -95,4 +99,4 @@ class AppRouter { | ||
95 | child: Text('No route defined for ${settings.name}')))); | 99 | child: Text('No route defined for ${settings.name}')))); |
96 | } | 100 | } |
97 | } | 101 | } |
98 | -} | ||
99 | \ No newline at end of file | 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 | +} |