Commit 1e7094e3fd9fe769a29f0b54dc8a934fb015de78
1 parent
f5fc01c1
feat:适配ipad
Showing
10 changed files
with
51 additions
and
21 deletions
lib/common/pages/wow_web_page.dart
... | ... | @@ -61,7 +61,12 @@ class _WowWebViewPageState extends State<WowWebViewPage> { |
61 | 61 | appBar: WEAppBar( |
62 | 62 | titleText: widget.webViewTitle, |
63 | 63 | ), |
64 | - body: WebViewWidget(controller: _controller,), | |
64 | + body: Container( | |
65 | + color: Colors.white, | |
66 | + child: SafeArea( | |
67 | + child: WebViewWidget(controller: _controller,), | |
68 | + ) | |
69 | + ), | |
65 | 70 | ); |
66 | 71 | } |
67 | 72 | } | ... | ... |
lib/generated/json/course_entity.g.dart
... | ... | @@ -86,6 +86,10 @@ CourseCourseLessons $CourseCourseLessonsFromJson(Map<String, dynamic> json) { |
86 | 86 | if (status != null) { |
87 | 87 | courseCourseLessons.status = status; |
88 | 88 | } |
89 | + final String? courseModuleThemeColor = jsonConvert.convert<String>(json['courseModuleThemeColor']); | |
90 | + if (courseModuleThemeColor != null) { | |
91 | + courseCourseLessons.courseModuleThemeColor = courseModuleThemeColor; | |
92 | + } | |
89 | 93 | return courseCourseLessons; |
90 | 94 | } |
91 | 95 | |
... | ... | @@ -103,5 +107,6 @@ Map<String, dynamic> $CourseCourseLessonsToJson(CourseCourseLessons entity) { |
103 | 107 | data['name'] = entity.name; |
104 | 108 | data['sortOrder'] = entity.sortOrder; |
105 | 109 | data['status'] = entity.status; |
110 | + data['courseModuleThemeColor'] = entity.courseModuleThemeColor; | |
106 | 111 | return data; |
107 | 112 | } |
108 | 113 | \ No newline at end of file | ... | ... |
lib/main.dart
1 | 1 | import 'dart:io'; |
2 | + | |
2 | 3 | import 'package:flutter/material.dart'; |
3 | 4 | import 'package:flutter/services.dart'; |
4 | -import 'package:limiting_direction_csx/limiting_direction_csx.dart'; | |
5 | 5 | import 'package:wow_english/app/app.dart'; |
6 | -import 'package:flutter/services.dart'; | |
7 | 6 | |
8 | 7 | void main() { |
9 | 8 | ///设置设备默认方向 | ... | ... |
lib/models/course_entity.dart
lib/pages/home/home_page.dart
1 | 1 | import 'package:flutter/material.dart'; |
2 | 2 | import 'package:flutter_bloc/flutter_bloc.dart'; |
3 | 3 | import 'package:flutter_screenutil/flutter_screenutil.dart'; |
4 | -import 'package:wow_english/app/app.dart'; | |
5 | 4 | import 'package:wow_english/common/core/user_util.dart'; |
6 | 5 | import 'package:wow_english/common/extension/string_extension.dart'; |
7 | 6 | import 'package:wow_english/models/course_entity.dart'; | ... | ... |
lib/pages/home/widgets/home_tab_header_widget.dart
... | ... | @@ -71,10 +71,10 @@ class HomeTabHeaderWidget extends StatelessWidget { |
71 | 71 | 20.horizontalSpace, |
72 | 72 | const Expanded( |
73 | 73 | child: Text( |
74 | - 'learn wow', | |
75 | - textAlign: TextAlign.left, | |
76 | - style: TextStyle(color: Colors.white, fontSize: 30.0), | |
77 | - )), | |
74 | + 'learn wow', | |
75 | + textAlign: TextAlign.left, | |
76 | + style: TextStyle(color: Colors.white, fontSize: 30.0), | |
77 | + )), | |
78 | 78 | IconButton( |
79 | 79 | onPressed: () { |
80 | 80 | if (actionTap != null) { |
... | ... | @@ -106,7 +106,7 @@ class HomeTabHeaderWidget extends StatelessWidget { |
106 | 106 | // ), |
107 | 107 | ScreenUtil().bottomBarHeight.horizontalSpace, |
108 | 108 | ], |
109 | - ), | |
109 | + ) | |
110 | 110 | ); |
111 | 111 | } |
112 | 112 | } | ... | ... |
lib/pages/home/widgets/home_vidoe_item.dart
... | ... | @@ -12,17 +12,18 @@ class HomeVideoItem extends StatelessWidget { |
12 | 12 | @override |
13 | 13 | Widget build(BuildContext context) { |
14 | 14 | return Padding( |
15 | - padding: EdgeInsets.symmetric(horizontal: 12.w), | |
15 | + padding: EdgeInsets.symmetric(horizontal: 12.w,vertical: 24.h), | |
16 | 16 | child: Container( |
17 | 17 | width: 165.w, |
18 | 18 | padding: EdgeInsets.symmetric(horizontal: 16.w,vertical: 24.h), |
19 | 19 | decoration: BoxDecoration( |
20 | 20 | image: DecorationImage( |
21 | 21 | image: AssetImage('gendubeij'.assetPng), |
22 | + fit: BoxFit.fill | |
22 | 23 | ), |
23 | 24 | ), |
24 | 25 | child: Column( |
25 | - mainAxisAlignment: MainAxisAlignment.spaceAround, | |
26 | + mainAxisAlignment: MainAxisAlignment.spaceBetween, | |
26 | 27 | children: [ |
27 | 28 | Expanded( |
28 | 29 | child: Container( |
... | ... | @@ -35,7 +36,7 @@ class HomeVideoItem extends StatelessWidget { |
35 | 36 | ), |
36 | 37 | child: OwImageWidget( |
37 | 38 | name: lessons?.coverUrl??'', |
38 | - fit: BoxFit.fill, | |
39 | + fit: BoxFit.fitHeight, | |
39 | 40 | ), |
40 | 41 | )), |
41 | 42 | 24.verticalSpace, | ... | ... |
lib/pages/listen/widgets/listen_item_widget.dart
... | ... | @@ -25,7 +25,7 @@ class ListenItemWidget extends StatelessWidget { |
25 | 25 | clickEvent.call(); |
26 | 26 | }, |
27 | 27 | child: ClipRRect( |
28 | - borderRadius:BorderRadius.circular(90.r), | |
28 | + borderRadius:BorderRadius.circular(90.h), | |
29 | 29 | child: Stack( |
30 | 30 | alignment:Alignment.center, |
31 | 31 | children: [ | ... | ... |
lib/pages/login/forgetpwd/bloc/forget_pwd_home_bloc.dart
1 | 1 | import 'package:common_utils/common_utils.dart'; |
2 | 2 | import 'package:flutter/cupertino.dart'; |
3 | 3 | import 'package:flutter_bloc/flutter_bloc.dart'; |
4 | +import 'package:wow_english/common/request/dao/user_dao.dart'; | |
5 | +import 'package:wow_english/common/request/exception.dart'; | |
6 | +import 'package:wow_english/utils/loading.dart'; | |
4 | 7 | import 'package:wow_english/utils/toast_util.dart'; |
5 | 8 | |
6 | 9 | part 'forget_pwd_home_event.dart'; |
... | ... | @@ -65,5 +68,21 @@ class ForgetPwdHomeBloc extends Bloc<ForgetPwdHomeEvent, ForgetPwdHomeState> { |
65 | 68 | emitter(SetPwdCheckCodeState()); |
66 | 69 | } |
67 | 70 | |
68 | - void _sendSmsCode(SendSmsCodeEvent event, Emitter<ForgetPwdHomeState> emitter) async {} | |
71 | + void _sendSmsCode(SendSmsCodeEvent event, Emitter<ForgetPwdHomeState> emitter) async { | |
72 | + final phoneNumber = phoneNumController.text; | |
73 | + if (!RegexUtil.isMobileExact(phoneNumber)) { | |
74 | + showToast('请检查手机号'); | |
75 | + return; | |
76 | + } | |
77 | + try { | |
78 | + await loading(() async { | |
79 | + await UserDao.sendCode(phoneNumber,smsType:'change_passWord'); | |
80 | + }); | |
81 | + emitter(SendSmsCodeState()); | |
82 | + } catch (e) { | |
83 | + if(e is ApiException) { | |
84 | + showToast(e.message??'网络请求失败'); | |
85 | + } | |
86 | + } | |
87 | + } | |
69 | 88 | } | ... | ... |
lib/pages/repeataftercontent/repeat_after_content_page.dart
... | ... | @@ -39,7 +39,7 @@ class _RepeatAfterContentPage extends StatelessWidget { |
39 | 39 | Widget build(BuildContext context) { |
40 | 40 | return BlocListener<RepeatAfterContentBloc,RepeatAfterContentState>( |
41 | 41 | listener: (context,state){ |
42 | - debugPrint('123'); | |
42 | + | |
43 | 43 | }, |
44 | 44 | child: _repeatAfterContentView(), |
45 | 45 | ); |
... | ... | @@ -56,7 +56,6 @@ class _RepeatAfterContentPage extends StatelessWidget { |
56 | 56 | children: [ |
57 | 57 | ///返回 |
58 | 58 | Positioned( |
59 | - top: 13.h, | |
60 | 59 | child: GestureDetector( |
61 | 60 | onTap: () => popPage(), |
62 | 61 | child: Image.asset( |
... | ... | @@ -68,7 +67,7 @@ class _RepeatAfterContentPage extends StatelessWidget { |
68 | 67 | ), |
69 | 68 | ///左侧视频区 |
70 | 69 | Positioned( |
71 | - top: 53.h, | |
70 | + top: 40.h, | |
72 | 71 | left: 20.w, |
73 | 72 | child: Container( |
74 | 73 | width: 285.w, |
... | ... | @@ -85,8 +84,8 @@ class _RepeatAfterContentPage extends StatelessWidget { |
85 | 84 | ), |
86 | 85 | ///右侧操作区 |
87 | 86 | Positioned( |
88 | - top: 53.h, | |
89 | - right: 25.w, | |
87 | + top: 40.h, | |
88 | + left: 331.w, | |
90 | 89 | child: Container( |
91 | 90 | width: 240.w, |
92 | 91 | height: 299.h, |
... | ... | @@ -103,8 +102,9 @@ class _RepeatAfterContentPage extends StatelessWidget { |
103 | 102 | child: bloc.isRecord?_buildLongPressWidget():_buildPlayVideoWidget(), |
104 | 103 | ), |
105 | 104 | ), |
105 | + ///连接 | |
106 | 106 | Positioned( |
107 | - top: 72.h, | |
107 | + top: 59.h, | |
108 | 108 | left: 274.w, |
109 | 109 | child: Container( |
110 | 110 | width: 87.w, |
... | ... | @@ -119,7 +119,7 @@ class _RepeatAfterContentPage extends StatelessWidget { |
119 | 119 | ), |
120 | 120 | ///跟读 |
121 | 121 | Positioned( |
122 | - top: 29.h, | |
122 | + top: 16.h, | |
123 | 123 | left: 65.w, |
124 | 124 | child: Container( |
125 | 125 | width: 185.w, |
... | ... | @@ -130,6 +130,7 @@ class _RepeatAfterContentPage extends StatelessWidget { |
130 | 130 | fit: BoxFit.fill |
131 | 131 | ), |
132 | 132 | ), |
133 | + alignment: Alignment.center, | |
133 | 134 | child: Text( |
134 | 135 | 'read title', |
135 | 136 | textAlign: TextAlign.center, | ... | ... |