Commit 82c8633c4dc35f8c5bae3f4f69b512cd9b6c3402
1 parent
fac6a671
音频添加 页面优化
Showing
22 changed files
with
98 additions
and
87 deletions
.fvm/flutter_sdk
.fvm/fvm_config.json
assets/images/micro_phone.gif
assets/images/reade_answer.gif
100644 → 100755
assets/images/voice.png
assets/sounds/class_time.mp3
0 → 100644
No preview for this file type
assets/sounds/game_time.mp3
0 → 100644
No preview for this file type
assets/sounds/music_time.mp3
0 → 100644
No preview for this file type
assets/sounds/quiz_time.mp3
0 → 100644
No preview for this file type
assets/sounds/reading_time.mp3
0 → 100644
No preview for this file type
assets/sounds/video_time.mp3
0 → 100644
No preview for this file type
assets/sounds/welcome_to_wow.mp3
0 → 100644
No preview for this file type
ios/Runner.xcodeproj/project.pbxproj
@@ -2327,7 +2327,7 @@ | @@ -2327,7 +2327,7 @@ | ||
2327 | CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; | 2327 | CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; |
2328 | CODE_SIGN_IDENTITY = "Apple Development"; | 2328 | CODE_SIGN_IDENTITY = "Apple Development"; |
2329 | CODE_SIGN_STYLE = Automatic; | 2329 | CODE_SIGN_STYLE = Automatic; |
2330 | - CURRENT_PROJECT_VERSION = 13; | 2330 | + CURRENT_PROJECT_VERSION = 15; |
2331 | DEVELOPMENT_TEAM = T8P9KW8GWH; | 2331 | DEVELOPMENT_TEAM = T8P9KW8GWH; |
2332 | ENABLE_BITCODE = NO; | 2332 | ENABLE_BITCODE = NO; |
2333 | INFOPLIST_FILE = Runner/Info.plist; | 2333 | INFOPLIST_FILE = Runner/Info.plist; |
@@ -2671,7 +2671,7 @@ | @@ -2671,7 +2671,7 @@ | ||
2671 | CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; | 2671 | CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; |
2672 | CODE_SIGN_IDENTITY = "Apple Development"; | 2672 | CODE_SIGN_IDENTITY = "Apple Development"; |
2673 | CODE_SIGN_STYLE = Automatic; | 2673 | CODE_SIGN_STYLE = Automatic; |
2674 | - CURRENT_PROJECT_VERSION = 13; | 2674 | + CURRENT_PROJECT_VERSION = 15; |
2675 | DEVELOPMENT_TEAM = T8P9KW8GWH; | 2675 | DEVELOPMENT_TEAM = T8P9KW8GWH; |
2676 | ENABLE_BITCODE = NO; | 2676 | ENABLE_BITCODE = NO; |
2677 | HEADER_SEARCH_PATHS = ( | 2677 | HEADER_SEARCH_PATHS = ( |
@@ -2876,7 +2876,7 @@ | @@ -2876,7 +2876,7 @@ | ||
2876 | CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; | 2876 | CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; |
2877 | CODE_SIGN_IDENTITY = "Apple Development"; | 2877 | CODE_SIGN_IDENTITY = "Apple Development"; |
2878 | CODE_SIGN_STYLE = Automatic; | 2878 | CODE_SIGN_STYLE = Automatic; |
2879 | - CURRENT_PROJECT_VERSION = 13; | 2879 | + CURRENT_PROJECT_VERSION = 15; |
2880 | DEVELOPMENT_TEAM = T8P9KW8GWH; | 2880 | DEVELOPMENT_TEAM = T8P9KW8GWH; |
2881 | ENABLE_BITCODE = NO; | 2881 | ENABLE_BITCODE = NO; |
2882 | INFOPLIST_FILE = Runner/Info.plist; | 2882 | INFOPLIST_FILE = Runner/Info.plist; |
ios/Runner/Info.plist
@@ -77,11 +77,11 @@ | @@ -77,11 +77,11 @@ | ||
77 | <true/> | 77 | <true/> |
78 | </dict> | 78 | </dict> |
79 | <key>NSCameraUsageDescription</key> | 79 | <key>NSCameraUsageDescription</key> |
80 | - <string>需要访问相机完成拍照</string> | 80 | + <string>需要访问相机,完成修改头像功能</string> |
81 | <key>NSMicrophoneUsageDescription</key> | 81 | <key>NSMicrophoneUsageDescription</key> |
82 | - <string>需要获取录音完成后续功能</string> | 82 | + <string>需要获取录音,完成上课功能</string> |
83 | <key>NSPhotoLibraryUsageDescription</key> | 83 | <key>NSPhotoLibraryUsageDescription</key> |
84 | - <string>需要获取照片用来修改头像</string> | 84 | + <string>需要获取照片,完成上传头像功能</string> |
85 | <key>UIApplicationSupportsIndirectInputEvents</key> | 85 | <key>UIApplicationSupportsIndirectInputEvents</key> |
86 | <true/> | 86 | <true/> |
87 | <key>UILaunchStoryboardName</key> | 87 | <key>UILaunchStoryboardName</key> |
lib/pages/home/bloc.dart
1 | +import 'package:audioplayers/audioplayers.dart'; | ||
1 | import 'package:bloc/bloc.dart'; | 2 | import 'package:bloc/bloc.dart'; |
3 | +import 'package:wow_english/common/extension/string_extension.dart'; | ||
2 | 4 | ||
3 | import '../../common/core/app_config_helper.dart'; | 5 | import '../../common/core/app_config_helper.dart'; |
4 | import '../../common/request/dao/system_dao.dart'; | 6 | import '../../common/request/dao/system_dao.dart'; |
@@ -16,6 +18,7 @@ class HomeBloc extends Bloc<HomeEvent, HomeState> { | @@ -16,6 +18,7 @@ class HomeBloc extends Bloc<HomeEvent, HomeState> { | ||
16 | bool exchangeResult = false; | 18 | bool exchangeResult = false; |
17 | 19 | ||
18 | void _init(InitEvent event, Emitter<HomeState> emit) async { | 20 | void _init(InitEvent event, Emitter<HomeState> emit) async { |
21 | + AudioPlayer().play(AssetSource('welcome_to_wow'.assetMp3)); | ||
19 | await _checkUpdate(emit); | 22 | await _checkUpdate(emit); |
20 | } | 23 | } |
21 | 24 |
lib/pages/home/view.dart
1 | +import 'package:audioplayers/audioplayers.dart'; | ||
1 | import 'package:flutter/material.dart'; | 2 | import 'package:flutter/material.dart'; |
2 | import 'package:flutter_app_update/azhon_app_update.dart'; | 3 | import 'package:flutter_app_update/azhon_app_update.dart'; |
3 | import 'package:flutter_app_update/update_model.dart'; | 4 | import 'package:flutter_app_update/update_model.dart'; |
@@ -70,6 +71,8 @@ class _HomePageView extends StatelessWidget { | @@ -70,6 +71,8 @@ class _HomePageView extends StatelessWidget { | ||
70 | child: GestureDetector( | 71 | child: GestureDetector( |
71 | onTap: () { | 72 | onTap: () { |
72 | _checkPermission(() { | 73 | _checkPermission(() { |
74 | + AudioPlayer() | ||
75 | + .play(AssetSource('class_time'.assetMp3)); | ||
73 | pushNamed(AppRouteName.courseUnit) | 76 | pushNamed(AppRouteName.courseUnit) |
74 | .then((value) => { | 77 | .then((value) => { |
75 | if (value != null) | 78 | if (value != null) |
@@ -120,19 +123,9 @@ class _HomePageView extends StatelessWidget { | @@ -120,19 +123,9 @@ class _HomePageView extends StatelessWidget { | ||
120 | child: Column( | 123 | child: Column( |
121 | mainAxisAlignment: MainAxisAlignment.center, | 124 | mainAxisAlignment: MainAxisAlignment.center, |
122 | children: [ | 125 | children: [ |
123 | - Stack( | ||
124 | - alignment: AlignmentDirectional.center, | ||
125 | - children: [ | ||
126 | - Image.asset( | ||
127 | - 'bg_frame_module'.assetPng, | ||
128 | - width: 162.5.w, | ||
129 | - height: 203.5.h), | ||
130 | - Image.asset('xe_shop'.assetPng, | ||
131 | - width: 140.5.w, height: 172.h) | ||
132 | - ]), | ||
133 | - 44.verticalSpace, | ||
134 | - // Image.asset('label_module_game'.assetPng, | ||
135 | - // width: 124.w, height: 34.h), | 126 | + Image.asset('xe_shop'.assetPng, |
127 | + width: 140.5.w, height: 172.h), | ||
128 | + 44.verticalSpace | ||
136 | ], | 129 | ], |
137 | )); | 130 | )); |
138 | }), | 131 | }), |
@@ -143,6 +136,8 @@ class _HomePageView extends StatelessWidget { | @@ -143,6 +136,8 @@ class _HomePageView extends StatelessWidget { | ||
143 | return GestureDetector( | 136 | return GestureDetector( |
144 | onTap: () { | 137 | onTap: () { |
145 | _checkPermission(() { | 138 | _checkPermission(() { |
139 | + AudioPlayer().play( | ||
140 | + AssetSource('game_time'.assetMp3)); | ||
146 | pushNamed(AppRouteName.games); | 141 | pushNamed(AppRouteName.games); |
147 | }, bloc); | 142 | }, bloc); |
148 | }, | 143 | }, |
lib/pages/practice/topic_picture_page.dart
@@ -59,7 +59,12 @@ class _TopicPicturePage extends StatelessWidget { | @@ -59,7 +59,12 @@ class _TopicPicturePage extends StatelessWidget { | ||
59 | builder: (context, state) { | 59 | builder: (context, state) { |
60 | final bloc = BlocProvider.of<TopicPictureBloc>(context); | 60 | final bloc = BlocProvider.of<TopicPictureBloc>(context); |
61 | return Container( | 61 | return Container( |
62 | - color: Colors.white, | 62 | + decoration: BoxDecoration( |
63 | + image: DecorationImage( | ||
64 | + image: AssetImage('read_background'.assetPng), // 背景图片路径 | ||
65 | + fit: BoxFit.cover, // 适应图片的方式 | ||
66 | + ), | ||
67 | + ), | ||
63 | child: Stack( | 68 | child: Stack( |
64 | children: [ | 69 | children: [ |
65 | Column( | 70 | Column( |
@@ -75,6 +80,7 @@ class _TopicPicturePage extends StatelessWidget { | @@ -75,6 +80,7 @@ class _TopicPicturePage extends StatelessWidget { | ||
75 | // Navigator.pop(context); | 80 | // Navigator.pop(context); |
76 | }, | 81 | }, |
77 | ), | 82 | ), |
83 | + 35.verticalSpace, | ||
78 | Expanded( | 84 | Expanded( |
79 | child: PageView.builder( | 85 | child: PageView.builder( |
80 | itemCount: bloc.entity?.topics?.length, | 86 | itemCount: bloc.entity?.topics?.length, |
@@ -109,12 +115,7 @@ class _TopicPicturePage extends StatelessWidget { | @@ -109,12 +115,7 @@ class _TopicPicturePage extends StatelessWidget { | ||
109 | }), | 115 | }), |
110 | ) | 116 | ) |
111 | ], | 117 | ], |
112 | - ), | ||
113 | - Positioned( | ||
114 | - left: 0, | ||
115 | - right: 0, | ||
116 | - bottom: 0, | ||
117 | - child: Image.asset('bottom_grass'.assetPng)) | 118 | + ) |
118 | ], | 119 | ], |
119 | ), | 120 | ), |
120 | ); | 121 | ); |
@@ -299,7 +300,7 @@ class _TopicPicturePage extends StatelessWidget { | @@ -299,7 +300,7 @@ class _TopicPicturePage extends StatelessWidget { | ||
299 | 26.verticalSpace, | 300 | 26.verticalSpace, |
300 | SizedBox( | 301 | SizedBox( |
301 | height: 143.h, | 302 | height: 143.h, |
302 | - width: 163.w * (topics?.topicAnswerList?.length ?? 0), | 303 | + width: 203.w * (topics?.topicAnswerList?.length ?? 0), |
303 | child: ListView.builder( | 304 | child: ListView.builder( |
304 | scrollDirection: Axis.horizontal, | 305 | scrollDirection: Axis.horizontal, |
305 | physics: const NeverScrollableScrollPhysics(), | 306 | physics: const NeverScrollableScrollPhysics(), |
@@ -321,7 +322,7 @@ class _TopicPicturePage extends StatelessWidget { | @@ -321,7 +322,7 @@ class _TopicPicturePage extends StatelessWidget { | ||
321 | builder: (context, state) { | 322 | builder: (context, state) { |
322 | final bloc = BlocProvider.of<TopicPictureBloc>(context); | 323 | final bloc = BlocProvider.of<TopicPictureBloc>(context); |
323 | return Container( | 324 | return Container( |
324 | - padding: EdgeInsets.symmetric(horizontal: 10.w), | 325 | + padding: EdgeInsets.symmetric(horizontal: 20.w), |
325 | child: GestureDetector( | 326 | child: GestureDetector( |
326 | onTap: () => bloc.add(SelectItemEvent(index)), | 327 | onTap: () => bloc.add(SelectItemEvent(index)), |
327 | child: Container( | 328 | child: Container( |
@@ -333,15 +334,13 @@ class _TopicPicturePage extends StatelessWidget { | @@ -333,15 +334,13 @@ class _TopicPicturePage extends StatelessWidget { | ||
333 | borderRadius: BorderRadius.circular(15), | 334 | borderRadius: BorderRadius.circular(15), |
334 | ), | 335 | ), |
335 | height: 143.h, | 336 | height: 143.h, |
336 | - width: 143.w, | 337 | + width: 163.w, |
337 | child: Container( | 338 | child: Container( |
338 | decoration: BoxDecoration( | 339 | decoration: BoxDecoration( |
339 | color: Colors.white, | 340 | color: Colors.white, |
340 | borderRadius: BorderRadius.circular(15), | 341 | borderRadius: BorderRadius.circular(15), |
341 | - border: Border.all( | ||
342 | - width: 1.0, color: const Color(0xFF140C10)), | ||
343 | image: DecorationImage( | 342 | image: DecorationImage( |
344 | - fit: BoxFit.fitWidth, | 343 | + fit: BoxFit.fill, |
345 | image: NetworkImage(answerList?.picUrl ?? ''))), | 344 | image: NetworkImage(answerList?.picUrl ?? ''))), |
346 | ), | 345 | ), |
347 | ), | 346 | ), |
@@ -449,12 +448,18 @@ class _TopicPicturePage extends StatelessWidget { | @@ -449,12 +448,18 @@ class _TopicPicturePage extends StatelessWidget { | ||
449 | return Row( | 448 | return Row( |
450 | mainAxisAlignment: MainAxisAlignment.center, | 449 | mainAxisAlignment: MainAxisAlignment.center, |
451 | children: [ | 450 | children: [ |
452 | - OwImageWidget( | ||
453 | - name: topics?.picUrl ?? '', | ||
454 | - height: 186.h, | ||
455 | - width: 186.w, | 451 | + ClipRRect( |
452 | + borderRadius: BorderRadius.circular(20), | ||
453 | + child: Container( | ||
454 | + color: Colors.white, | ||
455 | + child: OwImageWidget( | ||
456 | + name: topics?.picUrl ?? '', | ||
457 | + height: 186.h, | ||
458 | + width: 186.w, | ||
459 | + ), | ||
460 | + ), | ||
456 | ), | 461 | ), |
457 | - 160.horizontalSpace, | 462 | + 120.horizontalSpace, |
458 | Column( | 463 | Column( |
459 | mainAxisAlignment: MainAxisAlignment.center, | 464 | mainAxisAlignment: MainAxisAlignment.center, |
460 | children: [ | 465 | children: [ |
@@ -472,8 +477,8 @@ class _TopicPicturePage extends StatelessWidget { | @@ -472,8 +477,8 @@ class _TopicPicturePage extends StatelessWidget { | ||
472 | bloc.voicePlayState == VoicePlayState.playing | 477 | bloc.voicePlayState == VoicePlayState.playing |
473 | ? 'reade_answer'.assetGif | 478 | ? 'reade_answer'.assetGif |
474 | : 'voice'.assetPng, | 479 | : 'voice'.assetPng, |
475 | - height: 52.h, | ||
476 | - width: 46.w, | 480 | + height: 45.h, |
481 | + width: 45.w, | ||
477 | ), | 482 | ), |
478 | 10.horizontalSpace, | 483 | 10.horizontalSpace, |
479 | Text(topics?.word ?? '') | 484 | Text(topics?.word ?? '') |
@@ -506,8 +511,8 @@ class _TopicPicturePage extends StatelessWidget { | @@ -506,8 +511,8 @@ class _TopicPicturePage extends StatelessWidget { | ||
506 | bloc.isVoicing | 511 | bloc.isVoicing |
507 | ? 'micro_phone'.assetGif | 512 | ? 'micro_phone'.assetGif |
508 | : 'micro_phone'.assetPng, | 513 | : 'micro_phone'.assetPng, |
509 | - height: 75.w, | ||
510 | - width: 75.w, | 514 | + height: 46.h, |
515 | + width: 46.w, | ||
511 | ), | 516 | ), |
512 | ) | 517 | ) |
513 | ], | 518 | ], |
lib/pages/practice/widgets/practice_header_widget.dart
@@ -12,9 +12,10 @@ class PracticeHeaderWidget extends StatelessWidget { | @@ -12,9 +12,10 @@ class PracticeHeaderWidget extends StatelessWidget { | ||
12 | @override | 12 | @override |
13 | Widget build(BuildContext context) { | 13 | Widget build(BuildContext context) { |
14 | return Container( | 14 | return Container( |
15 | - color: Colors.white, | 15 | + color: Colors.transparent, |
16 | height: kToolbarHeight + 3.h, | 16 | height: kToolbarHeight + 3.h, |
17 | child: AppBar( | 17 | child: AppBar( |
18 | + backgroundColor: Colors.transparent, | ||
18 | leading: GestureDetector( | 19 | leading: GestureDetector( |
19 | child: Image.asset( | 20 | child: Image.asset( |
20 | 'back_around'.assetPng, | 21 | 'back_around'.assetPng, |
@@ -25,7 +26,7 @@ class PracticeHeaderWidget extends StatelessWidget { | @@ -25,7 +26,7 @@ class PracticeHeaderWidget extends StatelessWidget { | ||
25 | ), | 26 | ), |
26 | centerTitle: true, | 27 | centerTitle: true, |
27 | title: Container( | 28 | title: Container( |
28 | - height: 40.h, | 29 | + height: 20.h, |
29 | width: 100.w, // 容器宽度 | 30 | width: 100.w, // 容器宽度 |
30 | // padding: EdgeInsets.symmetric(horizontal: 27.w, vertical: 10.h), | 31 | // padding: EdgeInsets.symmetric(horizontal: 27.w, vertical: 10.h), |
31 | alignment: Alignment.center, | 32 | alignment: Alignment.center, |
lib/pages/reading/bloc/reading_event.dart
@@ -39,7 +39,7 @@ class XSVoiceStartEvent extends ReadingPageEvent { | @@ -39,7 +39,7 @@ class XSVoiceStartEvent extends ReadingPageEvent { | ||
39 | final String content; | 39 | final String content; |
40 | final String type; | 40 | final String type; |
41 | final String? userId; | 41 | final String? userId; |
42 | - XSVoiceStartEvent(this.content,this.type,this.userId); | 42 | + XSVoiceStartEvent(this.content, this.type, this.userId); |
43 | } | 43 | } |
44 | 44 | ||
45 | ///先声评测停止 | 45 | ///先声评测停止 |
@@ -52,4 +52,7 @@ class OnXSVoiceStateChangeEvent extends ReadingPageEvent {} | @@ -52,4 +52,7 @@ class OnXSVoiceStateChangeEvent extends ReadingPageEvent {} | ||
52 | class VoicePlayStateChangeEvent extends ReadingPageEvent {} | 52 | class VoicePlayStateChangeEvent extends ReadingPageEvent {} |
53 | 53 | ||
54 | ///录音播放 | 54 | ///录音播放 |
55 | -class PlayRecordAudioEvent extends ReadingPageEvent {} | ||
56 | \ No newline at end of file | 55 | \ No newline at end of file |
56 | +class PlayRecordAudioEvent extends ReadingPageEvent {} | ||
57 | + | ||
58 | +///播放下一页 | ||
59 | +class PlayNextPageEvent extends ReadingPageEvent {} |
lib/pages/reading/reading_page.dart
@@ -21,17 +21,16 @@ class ReadingPage extends StatelessWidget { | @@ -21,17 +21,16 @@ class ReadingPage extends StatelessWidget { | ||
21 | @override | 21 | @override |
22 | Widget build(BuildContext context) { | 22 | Widget build(BuildContext context) { |
23 | return BlocProvider( | 23 | return BlocProvider( |
24 | - create: (_) => ReadingPageBloc(context, PageController(), courseLessonId ?? '') | ||
25 | - ..add(InitBlocEvent()) | ||
26 | - ..add(RequestDataEvent()) | ||
27 | - ..add(XSVoiceInitEvent( | ||
28 | - { | ||
29 | - 'appKey':AppConsts.xsAppKey, | ||
30 | - 'service':AppConsts.xsAppService, | ||
31 | - 'secretKey':AppConsts.xsAppSecretKey, | ||
32 | - 'userId':UserUtil.getUser()!.id.toString(), | ||
33 | - } | ||
34 | - )), | 24 | + create: (_) => |
25 | + ReadingPageBloc(context, PageController(), courseLessonId ?? '') | ||
26 | + ..add(InitBlocEvent()) | ||
27 | + ..add(RequestDataEvent()) | ||
28 | + ..add(XSVoiceInitEvent({ | ||
29 | + 'appKey': AppConsts.xsAppKey, | ||
30 | + 'service': AppConsts.xsAppService, | ||
31 | + 'secretKey': AppConsts.xsAppSecretKey, | ||
32 | + 'userId': UserUtil.getUser()!.id.toString(), | ||
33 | + })), | ||
35 | child: _ReadingPage(), | 34 | child: _ReadingPage(), |
36 | ); | 35 | ); |
37 | } | 36 | } |
@@ -60,8 +59,8 @@ class _ReadingPage extends StatelessWidget { | @@ -60,8 +59,8 @@ class _ReadingPage extends StatelessWidget { | ||
60 | ); | 59 | ); |
61 | } | 60 | } |
62 | 61 | ||
63 | - Widget _readingPageView() => BlocBuilder<ReadingPageBloc, ReadingPageState>( | ||
64 | - builder: (context, state) { | 62 | + Widget _readingPageView() => |
63 | + BlocBuilder<ReadingPageBloc, ReadingPageState>(builder: (context, state) { | ||
65 | final bloc = BlocProvider.of<ReadingPageBloc>(context); | 64 | final bloc = BlocProvider.of<ReadingPageBloc>(context); |
66 | return Container( | 65 | return Container( |
67 | color: Colors.white, | 66 | color: Colors.white, |
@@ -84,16 +83,14 @@ class _ReadingPage extends StatelessWidget { | @@ -84,16 +83,14 @@ class _ReadingPage extends StatelessWidget { | ||
84 | children: [ | 83 | children: [ |
85 | Padding( | 84 | Padding( |
86 | padding: | 85 | padding: |
87 | - EdgeInsets.only(left: ScreenUtil().bottomBarHeight), | 86 | + EdgeInsets.only(left: ScreenUtil().bottomBarHeight), |
88 | child: IconButton( | 87 | child: IconButton( |
89 | onPressed: () { | 88 | onPressed: () { |
90 | - popPage( | ||
91 | - data:{ | ||
92 | - 'currentStep':bloc.currentPage, | ||
93 | - 'courseLessonId':bloc.courseLessonId, | ||
94 | - 'isCompleted':bloc.isLastPage(), | ||
95 | - } | ||
96 | - ); | 89 | + popPage(data: { |
90 | + 'currentStep': bloc.currentPage, | ||
91 | + 'courseLessonId': bloc.courseLessonId, | ||
92 | + 'isCompleted': bloc.isLastPage(), | ||
93 | + }); | ||
97 | }, | 94 | }, |
98 | icon: Image.asset( | 95 | icon: Image.asset( |
99 | 'back_around'.assetPng, | 96 | 'back_around'.assetPng, |
@@ -167,7 +164,7 @@ class _ReadingPage extends StatelessWidget { | @@ -167,7 +164,7 @@ class _ReadingPage extends StatelessWidget { | ||
167 | }, | 164 | }, |
168 | child: Image.asset( | 165 | child: Image.asset( |
169 | bloc.voicePlayState == VoicePlayState.playing && | 166 | bloc.voicePlayState == VoicePlayState.playing && |
170 | - bloc.isOriginAudioPlaying | 167 | + bloc.isOriginAudioPlaying |
171 | ? 'reade_answer'.assetGif | 168 | ? 'reade_answer'.assetGif |
172 | : 'voice'.assetPng, | 169 | : 'voice'.assetPng, |
173 | height: 40.h, | 170 | height: 40.h, |
@@ -179,12 +176,12 @@ class _ReadingPage extends StatelessWidget { | @@ -179,12 +176,12 @@ class _ReadingPage extends StatelessWidget { | ||
179 | ), | 176 | ), |
180 | Expanded( | 177 | Expanded( |
181 | child: Text( | 178 | child: Text( |
182 | - bloc.currentPageData()?.word?.trim() ?? '', | ||
183 | - style: TextStyle( | ||
184 | - color: const Color(0xFF333333), fontSize: 21.sp), | ||
185 | - maxLines: 2, | ||
186 | - overflow: TextOverflow.ellipsis, | ||
187 | - )), | 179 | + bloc.currentPageData()?.word?.trim() ?? '', |
180 | + style: TextStyle( | ||
181 | + color: const Color(0xFF333333), fontSize: 21.sp), | ||
182 | + maxLines: 2, | ||
183 | + overflow: TextOverflow.ellipsis, | ||
184 | + )), | ||
188 | SizedBox( | 185 | SizedBox( |
189 | width: 10.w, | 186 | width: 10.w, |
190 | ), | 187 | ), |
@@ -241,8 +238,7 @@ class _ReadingPage extends StatelessWidget { | @@ -241,8 +238,7 @@ class _ReadingPage extends StatelessWidget { | ||
241 | return Stack( | 238 | return Stack( |
242 | children: [ | 239 | children: [ |
243 | Positioned.fill( | 240 | Positioned.fill( |
244 | - child: | ||
245 | - Image.network(readings.picUrl ?? '', fit: BoxFit.cover), | 241 | + child: Image.network(readings.picUrl ?? '', fit: BoxFit.cover), |
246 | ), | 242 | ), |
247 | ], | 243 | ], |
248 | ); | 244 | ); |
lib/pages/section/section_page.dart
1 | +import 'package:audioplayers/audioplayers.dart'; | ||
1 | import 'package:flutter/cupertino.dart'; | 2 | import 'package:flutter/cupertino.dart'; |
2 | import 'package:flutter/material.dart'; | 3 | import 'package:flutter/material.dart'; |
3 | import 'package:flutter_bloc/flutter_bloc.dart'; | 4 | import 'package:flutter_bloc/flutter_bloc.dart'; |
@@ -96,12 +97,18 @@ class _SectionPageView extends StatelessWidget { | @@ -96,12 +97,18 @@ class _SectionPageView extends StatelessWidget { | ||
96 | state.courseType != SectionType.pictureBook.value) { | 97 | state.courseType != SectionType.pictureBook.value) { |
97 | ///视频类型 | 98 | ///视频类型 |
98 | ///获取视频课程内容 | 99 | ///获取视频课程内容 |
100 | + if (state.courseType == 1) { | ||
101 | + AudioPlayer().play(AssetSource('music_time'.assetMp3)); | ||
102 | + } else { | ||
103 | + AudioPlayer().play(AssetSource('video_time'.assetMp3)); | ||
104 | + } | ||
99 | bloc.add(RequestVideoLessonEvent( | 105 | bloc.add(RequestVideoLessonEvent( |
100 | state.courseLessonId, state.courseType)); | 106 | state.courseLessonId, state.courseType)); |
101 | return; | 107 | return; |
102 | } | 108 | } |
103 | 109 | ||
104 | if (state.courseType == SectionType.pictureBook.value) { | 110 | if (state.courseType == SectionType.pictureBook.value) { |
111 | + AudioPlayer().play(AssetSource('reading_time'.assetMp3)); | ||
105 | //绘本 | 112 | //绘本 |
106 | pushNamed(AppRouteName.reading, | 113 | pushNamed(AppRouteName.reading, |
107 | arguments: {'courseLessonId': state.courseLessonId}) | 114 | arguments: {'courseLessonId': state.courseLessonId}) |
@@ -121,6 +128,7 @@ class _SectionPageView extends StatelessWidget { | @@ -121,6 +128,7 @@ class _SectionPageView extends StatelessWidget { | ||
121 | 128 | ||
122 | if (state.courseType == SectionType.practice.value) { | 129 | if (state.courseType == SectionType.practice.value) { |
123 | //练习 | 130 | //练习 |
131 | + AudioPlayer().play(AssetSource('quiz_time'.assetMp3)); | ||
124 | pushNamed(AppRouteName.topicPic, | 132 | pushNamed(AppRouteName.topicPic, |
125 | arguments: {'courseLessonId': state.courseLessonId}) | 133 | arguments: {'courseLessonId': state.courseLessonId}) |
126 | .then((value) { | 134 | .then((value) { |
lib/pages/user/user_page.dart
@@ -173,15 +173,7 @@ class _UserView extends StatelessWidget { | @@ -173,15 +173,7 @@ class _UserView extends StatelessWidget { | ||
173 | UserUtil.getUser()?.phoneNum == '17718485544') | 173 | UserUtil.getUser()?.phoneNum == '17718485544') |
174 | ? 12.verticalSpace | 174 | ? 12.verticalSpace |
175 | : 1.verticalSpace), | 175 | : 1.verticalSpace), |
176 | - OutlinedButton( | ||
177 | - onPressed: () => pushNamed(AppRouteName.fogPwd), | ||
178 | - style: normalButtonStyle, | ||
179 | - child: Text( | ||
180 | - "修改密码", | ||
181 | - style: textStyle21sp, | ||
182 | - ), | ||
183 | - ), | ||
184 | - 12.verticalSpace, | 176 | + |
185 | Offstage( | 177 | Offstage( |
186 | offstage: AppConfigHelper.shouldHidePay(), | 178 | offstage: AppConfigHelper.shouldHidePay(), |
187 | child: OutlinedButton( | 179 | child: OutlinedButton( |
@@ -199,6 +191,15 @@ class _UserView extends StatelessWidget { | @@ -199,6 +191,15 @@ class _UserView extends StatelessWidget { | ||
199 | style: textStyle21sp, | 191 | style: textStyle21sp, |
200 | )), | 192 | )), |
201 | ), | 193 | ), |
194 | + 12.verticalSpace, | ||
195 | + OutlinedButton( | ||
196 | + onPressed: () => pushNamed(AppRouteName.fogPwd), | ||
197 | + style: normalButtonStyle, | ||
198 | + child: Text( | ||
199 | + "修改密码", | ||
200 | + style: textStyle21sp, | ||
201 | + ), | ||
202 | + ), | ||
202 | Offstage( | 203 | Offstage( |
203 | offstage: AppConfigHelper.shouldHidePay(), | 204 | offstage: AppConfigHelper.shouldHidePay(), |
204 | child: 12.verticalSpace, | 205 | child: 12.verticalSpace, |