Commit 4f9b0fa4f04f61d590806c7471fe9bdabe058264

Authored by 吴启风
1 parent d1ab5cb2

feat:语音跟读题90分以上增加自动翻页

lib/pages/practice/bloc/topic_picture_bloc.dart
... ... @@ -17,7 +17,6 @@ import 'package:wow_english/utils/audio_player_util.dart';
17 17 import 'package:wow_english/utils/toast_util.dart';
18 18  
19 19 import '../../../common/permission/permissionRequester.dart';
20   -import '../../../common/utils/click_with_music_controller.dart';
21 20 import '../../../common/utils/show_star_reward_dialog.dart';
22 21 import '../../../models/voice_result_type.dart';
23 22 import '../../../route/route.dart';
... ... @@ -291,15 +290,11 @@ class TopicPictureBloc
291 290 if (voiceResult.lottieFilePath != null) {
292 291 AudioPlayerUtil.getInstance().playAudio(voiceResult.audioType);
293 292 await showCheerRewardDialog(context, lottieFile: voiceResult.lottieFilePath!, onDismiss: () {
294   - if (isLastPage()) {
295   - showStepPage();
296   - }
  293 + autoFlipPageByVoice(score);
297 294 });
298 295 } else {
299 296 await AudioPlayerUtil.getInstance().playAudio(voiceResult.audioType);
300   - if (isLastPage()) {
301   - showStepPage();
302   - }
  297 + autoFlipPageByVoice(score);
303 298 }
304 299 }
305 300  
... ... @@ -358,6 +353,18 @@ class TopicPictureBloc
358 353 }
359 354 }
360 355  
  356 + ///语音题自动翻页
  357 + ///90分以上自动翻页
  358 + void autoFlipPageByVoice(int score) {
  359 + if (score >= 90) {
  360 + autoFlipPage();
  361 + } else {
  362 + if (isLastPage()) {
  363 + showStepPage();
  364 + }
  365 + }
  366 + }
  367 +
361 368 ///展示过渡页
362 369 void showStepPage() {
363 370 ///如果最后一页是语音问答题,评测完后自动翻页
... ...