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,7 +61,12 @@ class _WowWebViewPageState extends State<WowWebViewPage> { | ||
61 | appBar: WEAppBar( | 61 | appBar: WEAppBar( |
62 | titleText: widget.webViewTitle, | 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,6 +86,10 @@ CourseCourseLessons $CourseCourseLessonsFromJson(Map<String, dynamic> json) { | ||
86 | if (status != null) { | 86 | if (status != null) { |
87 | courseCourseLessons.status = status; | 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 | return courseCourseLessons; | 93 | return courseCourseLessons; |
90 | } | 94 | } |
91 | 95 | ||
@@ -103,5 +107,6 @@ Map<String, dynamic> $CourseCourseLessonsToJson(CourseCourseLessons entity) { | @@ -103,5 +107,6 @@ Map<String, dynamic> $CourseCourseLessonsToJson(CourseCourseLessons entity) { | ||
103 | data['name'] = entity.name; | 107 | data['name'] = entity.name; |
104 | data['sortOrder'] = entity.sortOrder; | 108 | data['sortOrder'] = entity.sortOrder; |
105 | data['status'] = entity.status; | 109 | data['status'] = entity.status; |
110 | + data['courseModuleThemeColor'] = entity.courseModuleThemeColor; | ||
106 | return data; | 111 | return data; |
107 | } | 112 | } |
108 | \ No newline at end of file | 113 | \ No newline at end of file |
lib/main.dart
1 | import 'dart:io'; | 1 | import 'dart:io'; |
2 | + | ||
2 | import 'package:flutter/material.dart'; | 3 | import 'package:flutter/material.dart'; |
3 | import 'package:flutter/services.dart'; | 4 | import 'package:flutter/services.dart'; |
4 | -import 'package:limiting_direction_csx/limiting_direction_csx.dart'; | ||
5 | import 'package:wow_english/app/app.dart'; | 5 | import 'package:wow_english/app/app.dart'; |
6 | -import 'package:flutter/services.dart'; | ||
7 | 6 | ||
8 | void main() { | 7 | void main() { |
9 | ///设置设备默认方向 | 8 | ///设置设备默认方向 |
lib/models/course_entity.dart
lib/pages/home/home_page.dart
1 | import 'package:flutter/material.dart'; | 1 | import 'package:flutter/material.dart'; |
2 | import 'package:flutter_bloc/flutter_bloc.dart'; | 2 | import 'package:flutter_bloc/flutter_bloc.dart'; |
3 | import 'package:flutter_screenutil/flutter_screenutil.dart'; | 3 | import 'package:flutter_screenutil/flutter_screenutil.dart'; |
4 | -import 'package:wow_english/app/app.dart'; | ||
5 | import 'package:wow_english/common/core/user_util.dart'; | 4 | import 'package:wow_english/common/core/user_util.dart'; |
6 | import 'package:wow_english/common/extension/string_extension.dart'; | 5 | import 'package:wow_english/common/extension/string_extension.dart'; |
7 | import 'package:wow_english/models/course_entity.dart'; | 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,10 +71,10 @@ class HomeTabHeaderWidget extends StatelessWidget { | ||
71 | 20.horizontalSpace, | 71 | 20.horizontalSpace, |
72 | const Expanded( | 72 | const Expanded( |
73 | child: Text( | 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 | IconButton( | 78 | IconButton( |
79 | onPressed: () { | 79 | onPressed: () { |
80 | if (actionTap != null) { | 80 | if (actionTap != null) { |
@@ -106,7 +106,7 @@ class HomeTabHeaderWidget extends StatelessWidget { | @@ -106,7 +106,7 @@ class HomeTabHeaderWidget extends StatelessWidget { | ||
106 | // ), | 106 | // ), |
107 | ScreenUtil().bottomBarHeight.horizontalSpace, | 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,17 +12,18 @@ class HomeVideoItem extends StatelessWidget { | ||
12 | @override | 12 | @override |
13 | Widget build(BuildContext context) { | 13 | Widget build(BuildContext context) { |
14 | return Padding( | 14 | return Padding( |
15 | - padding: EdgeInsets.symmetric(horizontal: 12.w), | 15 | + padding: EdgeInsets.symmetric(horizontal: 12.w,vertical: 24.h), |
16 | child: Container( | 16 | child: Container( |
17 | width: 165.w, | 17 | width: 165.w, |
18 | padding: EdgeInsets.symmetric(horizontal: 16.w,vertical: 24.h), | 18 | padding: EdgeInsets.symmetric(horizontal: 16.w,vertical: 24.h), |
19 | decoration: BoxDecoration( | 19 | decoration: BoxDecoration( |
20 | image: DecorationImage( | 20 | image: DecorationImage( |
21 | image: AssetImage('gendubeij'.assetPng), | 21 | image: AssetImage('gendubeij'.assetPng), |
22 | + fit: BoxFit.fill | ||
22 | ), | 23 | ), |
23 | ), | 24 | ), |
24 | child: Column( | 25 | child: Column( |
25 | - mainAxisAlignment: MainAxisAlignment.spaceAround, | 26 | + mainAxisAlignment: MainAxisAlignment.spaceBetween, |
26 | children: [ | 27 | children: [ |
27 | Expanded( | 28 | Expanded( |
28 | child: Container( | 29 | child: Container( |
@@ -35,7 +36,7 @@ class HomeVideoItem extends StatelessWidget { | @@ -35,7 +36,7 @@ class HomeVideoItem extends StatelessWidget { | ||
35 | ), | 36 | ), |
36 | child: OwImageWidget( | 37 | child: OwImageWidget( |
37 | name: lessons?.coverUrl??'', | 38 | name: lessons?.coverUrl??'', |
38 | - fit: BoxFit.fill, | 39 | + fit: BoxFit.fitHeight, |
39 | ), | 40 | ), |
40 | )), | 41 | )), |
41 | 24.verticalSpace, | 42 | 24.verticalSpace, |
lib/pages/listen/widgets/listen_item_widget.dart
@@ -25,7 +25,7 @@ class ListenItemWidget extends StatelessWidget { | @@ -25,7 +25,7 @@ class ListenItemWidget extends StatelessWidget { | ||
25 | clickEvent.call(); | 25 | clickEvent.call(); |
26 | }, | 26 | }, |
27 | child: ClipRRect( | 27 | child: ClipRRect( |
28 | - borderRadius:BorderRadius.circular(90.r), | 28 | + borderRadius:BorderRadius.circular(90.h), |
29 | child: Stack( | 29 | child: Stack( |
30 | alignment:Alignment.center, | 30 | alignment:Alignment.center, |
31 | children: [ | 31 | children: [ |
lib/pages/login/forgetpwd/bloc/forget_pwd_home_bloc.dart
1 | import 'package:common_utils/common_utils.dart'; | 1 | import 'package:common_utils/common_utils.dart'; |
2 | import 'package:flutter/cupertino.dart'; | 2 | import 'package:flutter/cupertino.dart'; |
3 | import 'package:flutter_bloc/flutter_bloc.dart'; | 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 | import 'package:wow_english/utils/toast_util.dart'; | 7 | import 'package:wow_english/utils/toast_util.dart'; |
5 | 8 | ||
6 | part 'forget_pwd_home_event.dart'; | 9 | part 'forget_pwd_home_event.dart'; |
@@ -65,5 +68,21 @@ class ForgetPwdHomeBloc extends Bloc<ForgetPwdHomeEvent, ForgetPwdHomeState> { | @@ -65,5 +68,21 @@ class ForgetPwdHomeBloc extends Bloc<ForgetPwdHomeEvent, ForgetPwdHomeState> { | ||
65 | emitter(SetPwdCheckCodeState()); | 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,7 +39,7 @@ class _RepeatAfterContentPage extends StatelessWidget { | ||
39 | Widget build(BuildContext context) { | 39 | Widget build(BuildContext context) { |
40 | return BlocListener<RepeatAfterContentBloc,RepeatAfterContentState>( | 40 | return BlocListener<RepeatAfterContentBloc,RepeatAfterContentState>( |
41 | listener: (context,state){ | 41 | listener: (context,state){ |
42 | - debugPrint('123'); | 42 | + |
43 | }, | 43 | }, |
44 | child: _repeatAfterContentView(), | 44 | child: _repeatAfterContentView(), |
45 | ); | 45 | ); |
@@ -56,7 +56,6 @@ class _RepeatAfterContentPage extends StatelessWidget { | @@ -56,7 +56,6 @@ class _RepeatAfterContentPage extends StatelessWidget { | ||
56 | children: [ | 56 | children: [ |
57 | ///返回 | 57 | ///返回 |
58 | Positioned( | 58 | Positioned( |
59 | - top: 13.h, | ||
60 | child: GestureDetector( | 59 | child: GestureDetector( |
61 | onTap: () => popPage(), | 60 | onTap: () => popPage(), |
62 | child: Image.asset( | 61 | child: Image.asset( |
@@ -68,7 +67,7 @@ class _RepeatAfterContentPage extends StatelessWidget { | @@ -68,7 +67,7 @@ class _RepeatAfterContentPage extends StatelessWidget { | ||
68 | ), | 67 | ), |
69 | ///左侧视频区 | 68 | ///左侧视频区 |
70 | Positioned( | 69 | Positioned( |
71 | - top: 53.h, | 70 | + top: 40.h, |
72 | left: 20.w, | 71 | left: 20.w, |
73 | child: Container( | 72 | child: Container( |
74 | width: 285.w, | 73 | width: 285.w, |
@@ -85,8 +84,8 @@ class _RepeatAfterContentPage extends StatelessWidget { | @@ -85,8 +84,8 @@ class _RepeatAfterContentPage extends StatelessWidget { | ||
85 | ), | 84 | ), |
86 | ///右侧操作区 | 85 | ///右侧操作区 |
87 | Positioned( | 86 | Positioned( |
88 | - top: 53.h, | ||
89 | - right: 25.w, | 87 | + top: 40.h, |
88 | + left: 331.w, | ||
90 | child: Container( | 89 | child: Container( |
91 | width: 240.w, | 90 | width: 240.w, |
92 | height: 299.h, | 91 | height: 299.h, |
@@ -103,8 +102,9 @@ class _RepeatAfterContentPage extends StatelessWidget { | @@ -103,8 +102,9 @@ class _RepeatAfterContentPage extends StatelessWidget { | ||
103 | child: bloc.isRecord?_buildLongPressWidget():_buildPlayVideoWidget(), | 102 | child: bloc.isRecord?_buildLongPressWidget():_buildPlayVideoWidget(), |
104 | ), | 103 | ), |
105 | ), | 104 | ), |
105 | + ///连接 | ||
106 | Positioned( | 106 | Positioned( |
107 | - top: 72.h, | 107 | + top: 59.h, |
108 | left: 274.w, | 108 | left: 274.w, |
109 | child: Container( | 109 | child: Container( |
110 | width: 87.w, | 110 | width: 87.w, |
@@ -119,7 +119,7 @@ class _RepeatAfterContentPage extends StatelessWidget { | @@ -119,7 +119,7 @@ class _RepeatAfterContentPage extends StatelessWidget { | ||
119 | ), | 119 | ), |
120 | ///跟读 | 120 | ///跟读 |
121 | Positioned( | 121 | Positioned( |
122 | - top: 29.h, | 122 | + top: 16.h, |
123 | left: 65.w, | 123 | left: 65.w, |
124 | child: Container( | 124 | child: Container( |
125 | width: 185.w, | 125 | width: 185.w, |
@@ -130,6 +130,7 @@ class _RepeatAfterContentPage extends StatelessWidget { | @@ -130,6 +130,7 @@ class _RepeatAfterContentPage extends StatelessWidget { | ||
130 | fit: BoxFit.fill | 130 | fit: BoxFit.fill |
131 | ), | 131 | ), |
132 | ), | 132 | ), |
133 | + alignment: Alignment.center, | ||
133 | child: Text( | 134 | child: Text( |
134 | 'read title', | 135 | 'read title', |
135 | textAlign: TextAlign.center, | 136 | textAlign: TextAlign.center, |