diff --git a/assets/images/bottom_grass.png b/assets/images/bottom_grass.png index bf99063..e3016e3 100644 --- a/assets/images/bottom_grass.png +++ b/assets/images/bottom_grass.png diff --git a/lib/common/dialogs/customer_dialog.dart b/lib/common/dialogs/customer_dialog.dart index 61bcadf..426ce41 100644 --- a/lib/common/dialogs/customer_dialog.dart +++ b/lib/common/dialogs/customer_dialog.dart @@ -1,6 +1,5 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:wow_english/route/route.dart'; class CustomerTwoActionDialog extends Dialog { const CustomerTwoActionDialog( diff --git a/lib/pages/home/widgets/home_tab_header_widget.dart b/lib/pages/home/widgets/home_tab_header_widget.dart index d732942..1b9a63b 100644 --- a/lib/pages/home/widgets/home_tab_header_widget.dart +++ b/lib/pages/home/widgets/home_tab_header_widget.dart @@ -83,13 +83,13 @@ class HomeTabHeaderWidget extends StatelessWidget { textAlign: TextAlign.left, style: const TextStyle(color: Colors.white, fontSize: 30.0), )), - IconButton( - onPressed: () { - if (actionTap != null) { - actionTap!(HeaderActionType.video); - } - }, - icon: Image.asset('video'.assetPng)), + // IconButton( + // onPressed: () { + // if (actionTap != null) { + // actionTap!(HeaderActionType.video); + // } + // }, + // icon: Image.asset('video'.assetPng)), IconButton( onPressed: () { if (actionTap != null) { diff --git a/lib/pages/lessons/widgets/lesson_item_widget.dart b/lib/pages/lessons/widgets/lesson_item_widget.dart index 774427f..cad8353 100644 --- a/lib/pages/lessons/widgets/lesson_item_widget.dart +++ b/lib/pages/lessons/widgets/lesson_item_widget.dart @@ -3,7 +3,6 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:wow_english/common/extension/string_extension.dart'; import 'package:wow_english/common/widgets/ow_image_widget.dart'; import 'package:wow_english/models/course_module_entity.dart'; -import 'package:wow_english/utils/color_util.dart'; import '../../home/courese_module_model.dart'; diff --git a/lib/pages/login/forgetpwd/forget_password_home_page.dart b/lib/pages/login/forgetpwd/forget_password_home_page.dart index 4f2f3f7..a1af920 100644 --- a/lib/pages/login/forgetpwd/forget_password_home_page.dart +++ b/lib/pages/login/forgetpwd/forget_password_home_page.dart @@ -53,115 +53,133 @@ class _ForgetPasswordHomePageView extends StatelessWidget { body: Container( color: Colors.white, child: SafeArea( - child: SingleChildScrollView( - child: Padding( - padding: EdgeInsets.only(left: 49.w, right: 10.w), - child: Column( - children: [ - 34.verticalSpace, - Row( - children: [ - Image.asset( - 'wow_logo'.assetPng, - height: 49.w, - width: 83.5.h, - ), - 12.5.horizontalSpace, - Text( - '修改密码\n请输入您的手机号和验证码吧', - style: TextStyle(fontSize: 16.sp, color: const Color(0xFF666666)), - ) - ], - ), - Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - child: Column( - children: [ - 44.5.verticalSpace, - Row( - children: [ - Image.asset( - 'phone'.assetPng, - height: 45.h, - width: 35.w, - ), - 15.horizontalSpace, - Expanded( - child: TextFieldCustomerWidget( - height: 50.h, - hitText: '请输入当前手机号', - textInputType: TextInputType.phone, - bgImageName: 'Input_layer_up', - onChangeValue: (String value) { - bloc.add(PhoneNumChangeEvent()); - }, - controller: bloc.phoneNumController, - )) - ], - ), - 11.5.verticalSpace, - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Image.asset( - 'lock'.assetPng, - height: 34.h, - width: 31.w, - ), - 18.5.horizontalSpace, - Expanded( - child: TextFieldCustomerWidget( - hitText: '请输入验证码', - bgImageName: 'Input_layer_down', - onChangeValue: (String value) { - bloc.add(CheckCodeChangeEvent()); - }, - textInputType: TextInputType.emailAddress, - controller: bloc.checkNumController, - )), - 16.5.horizontalSpace, - TimerWidget( - pageType: 1, - canSendSms: bloc.canSendSms, - sendSmsEvent: () => bloc.add(SendSmsCodeEvent()), - ) - ], - ) - ], - )), - 2.verticalSpace, - Image.asset( - 'steven_bride'.assetPng, - height: 173.h, - width: 157.w, - ) - ], + child: Stack( + children: [ + SingleChildScrollView( + child: Padding( + padding: EdgeInsets.only(left: 49.w, right: 10.w), + child: Column( + children: [ + 34.verticalSpace, + Row( + children: [ + Image.asset( + 'wow_logo'.assetPng, + height: 49.w, + width: 83.5.h, + ), + 12.5.horizontalSpace, + Text( + '修改密码\n请输入您的手机号和验证码吧', + style: TextStyle(fontSize: 16.sp, color: const Color(0xFF666666)), + ) + ], + ), + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: Column( + children: [ + 44.5.verticalSpace, + Row( + children: [ + Image.asset( + 'phone'.assetPng, + height: 45.h, + width: 35.w, + ), + 15.horizontalSpace, + Expanded( + child: TextFieldCustomerWidget( + height: 50.h, + hitText: '请输入当前手机号', + textInputType: TextInputType.phone, + bgImageName: 'Input_layer_up', + onChangeValue: (String value) { + bloc.add(PhoneNumChangeEvent()); + }, + controller: bloc.phoneNumController, + )) + ], + ), + 11.5.verticalSpace, + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Image.asset( + 'lock'.assetPng, + height: 34.h, + width: 31.w, + ), + 18.5.horizontalSpace, + Expanded( + child: TextFieldCustomerWidget( + hitText: '请输入验证码', + bgImageName: 'Input_layer_down', + onChangeValue: (String value) { + bloc.add(CheckCodeChangeEvent()); + }, + textInputType: TextInputType.emailAddress, + controller: bloc.checkNumController, + )), + 16.5.horizontalSpace, + TimerWidget( + pageType: 1, + canSendSms: bloc.canSendSms, + sendSmsEvent: () => bloc.add(SendSmsCodeEvent()), + ) + ], + ) + ], + )), + 2.verticalSpace, + Image.asset( + 'steven_bride'.assetPng, + height: 173.h, + width: 157.w, + ) + ], + ), + GestureDetector( + onTap: () { + if (bloc.canSetPwd) { + bloc.add(SetPassWordEvent()); + } + }, + child: Container( + decoration: BoxDecoration( + image: DecorationImage( + image: AssetImage(bloc.canSetPwd ? 'login_enter'.assetPng : 'login_enter_dis'.assetPng), + fit: BoxFit.fill), + ), + padding: EdgeInsets.symmetric(horizontal: 28.w, vertical: 14.h), + child: Text( + '确定', + style: TextStyle(fontSize: 16.sp, color: Colors.white), + ), + ), + ) + ], + ), ), - GestureDetector( - onTap: () { - if (bloc.canSetPwd) { - bloc.add(SetPassWordEvent()); - } + ), + Container( + padding: EdgeInsets.only(top: 16.h), + alignment: Alignment.topLeft, + child: IconButton( + onPressed: () { + Navigator.pop(context); }, - child: Container( - decoration: BoxDecoration( - image: DecorationImage( - image: AssetImage(bloc.canSetPwd ? 'login_enter'.assetPng : 'login_enter_dis'.assetPng), - fit: BoxFit.fill), - ), - padding: EdgeInsets.symmetric(horizontal: 28.w, vertical: 14.h), - child: Text( - '确定', - style: TextStyle(fontSize: 16.sp, color: Colors.white), - ), - ), - ) - ], - ), - ), - ), + icon: Image.asset( + 'back_around'.assetPng, + width: 40.w, + height: 40.h, + ) + ), + ), + ] + ) ), ), ); diff --git a/lib/pages/login/setpwd/bloc/set_pwd_bloc.dart b/lib/pages/login/setpwd/bloc/set_pwd_bloc.dart index 672b420..bda4f7c 100644 --- a/lib/pages/login/setpwd/bloc/set_pwd_bloc.dart +++ b/lib/pages/login/setpwd/bloc/set_pwd_bloc.dart @@ -1,4 +1,3 @@ -import 'package:common_utils/common_utils.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:wow_english/common/request/dao/user_dao.dart'; diff --git a/lib/pages/practice/bloc/topic_picture_bloc.dart b/lib/pages/practice/bloc/topic_picture_bloc.dart index c37e3cd..384c477 100644 --- a/lib/pages/practice/bloc/topic_picture_bloc.dart +++ b/lib/pages/practice/bloc/topic_picture_bloc.dart @@ -4,12 +4,15 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/services.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart'; +import 'package:permission_handler/permission_handler.dart'; import 'package:wow_english/common/request/dao/listen_dao.dart'; import 'package:wow_english/common/request/exception.dart'; import 'package:wow_english/models/course_process_entity.dart'; import 'package:wow_english/utils/loading.dart'; import 'package:wow_english/utils/toast_util.dart'; +import '../../../common/permission/permissionRequestPage.dart'; + part 'topic_picture_event.dart'; part 'topic_picture_state.dart'; @@ -56,7 +59,9 @@ class TopicPictureBloc extends Bloc { late AudioPlayer audioPlayer; - TopicPictureBloc(this.pageController, this.courseLessonId) : super(TopicPictureInitial()) { + final BuildContext context; + + TopicPictureBloc(this.context, this.pageController, this.courseLessonId) : super(TopicPictureInitial()) { on(_pageControllerChange); on(_voicePlayStateChange); on(_voiceXsResult); @@ -183,12 +188,24 @@ class TopicPictureBloc extends Bloc { ///先声测试 void _voiceXsTest(XSVoiceTestEvent event,Emitter emitter) async { await audioPlayer.stop(); - methodChannel.invokeMethod( - 'startVoice', - {'word':event.testWord,'type':event.type,'userId':event.userId.toString()} + // 调用封装好的权限检查和请求方法 + bool result = await permissionCheckAndRequest( + context, + Permission.microphone, + "录音" ); - _isVoicing = true; - emitter(XSVoiceTestState()); + if (result) { + methodChannel.invokeMethod( + 'startVoice', + { + 'word': event.testWord, + 'type': event.type, + 'userId': event.userId.toString() + } + ); + _isVoicing = true; + emitter(XSVoiceTestState()); + } } ///终止评测 diff --git a/lib/pages/practice/topic_picture_page.dart b/lib/pages/practice/topic_picture_page.dart index 3e41235..2c0dc48 100644 --- a/lib/pages/practice/topic_picture_page.dart +++ b/lib/pages/practice/topic_picture_page.dart @@ -21,6 +21,7 @@ class TopicPicturePage extends StatelessWidget { Widget build(BuildContext context) { return BlocProvider( create: (context) => TopicPictureBloc( + context, PageController(), courseLessonId??'', ) diff --git a/lib/pages/reading/bloc/reading_bloc.dart b/lib/pages/reading/bloc/reading_bloc.dart index 071c33c..91fb812 100644 --- a/lib/pages/reading/bloc/reading_bloc.dart +++ b/lib/pages/reading/bloc/reading_bloc.dart @@ -338,7 +338,7 @@ class ReadingPageBloc extends Bloc { nextPage(); } - Log.d("_onAudioPlayComplete _isOriginAudioPlaying=${_isOriginAudioPlaying} _voicePlayState=$_voicePlayState recordUrl=${currentPageData()?.recordUrl?.isNotEmpty}"); + Log.d("_onAudioPlayComplete _isOriginAudioPlaying=$_isOriginAudioPlaying _voicePlayState=$_voicePlayState recordUrl=${currentPageData()?.recordUrl?.isNotEmpty}"); if (_isOriginAudioPlaying && _voicePlayState == VoicePlayState.completed && currentPageData()?.recordUrl?.isNotEmpty != true) { ///如果刚刚完成原音播放&&录音为空,则开始录音 startRecord(currentPageData()?.word ?? ''); diff --git a/lib/pages/shop/exchane/bloc/exchange_lesson_bloc.dart b/lib/pages/shop/exchane/bloc/exchange_lesson_bloc.dart index 0b7432e..c1f1b17 100644 --- a/lib/pages/shop/exchane/bloc/exchange_lesson_bloc.dart +++ b/lib/pages/shop/exchane/bloc/exchange_lesson_bloc.dart @@ -1,8 +1,6 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:wow_english/common/request/exception.dart'; import 'package:wow_english/utils/loading.dart'; -import 'package:wow_english/utils/toast_util.dart'; import '../../../../common/request/dao/request_dao.dart'; diff --git a/lib/pages/shop/home/bloc/shop_home_bloc.dart b/lib/pages/shop/home/bloc/shop_home_bloc.dart index bd765c2..cac863c 100644 --- a/lib/pages/shop/home/bloc/shop_home_bloc.dart +++ b/lib/pages/shop/home/bloc/shop_home_bloc.dart @@ -1,4 +1,3 @@ -import 'dart:async'; import 'package:bloc/bloc.dart'; import 'package:meta/meta.dart'; diff --git a/lib/pages/tab/blocs/tab_bloc.dart b/lib/pages/tab/blocs/tab_bloc.dart index bbd9a3b..85e210e 100644 --- a/lib/pages/tab/blocs/tab_bloc.dart +++ b/lib/pages/tab/blocs/tab_bloc.dart @@ -1,4 +1,3 @@ -import 'dart:async'; import 'package:bloc/bloc.dart'; import 'package:meta/meta.dart';