diff --git a/lib/pages/practice/bloc/topic_picture_bloc.dart b/lib/pages/practice/bloc/topic_picture_bloc.dart index 807cc9c..59d46d5 100644 --- a/lib/pages/practice/bloc/topic_picture_bloc.dart +++ b/lib/pages/practice/bloc/topic_picture_bloc.dart @@ -92,11 +92,14 @@ class TopicPictureBloc extends Bloc { _isResultSoundPlaying = false; if (_forbiddenWhenCorrect) { _forbiddenWhenCorrect = false; - // 答对后自动翻页 - pageController.nextPage( - duration: const Duration(milliseconds: 500), - curve: Curves.ease, - ); + debugPrint('播放完成后解除禁止'); + if (event == PlayerState.completed) { + // 答对后且播放完自动翻页 + pageController.nextPage( + duration: const Duration(milliseconds: 500), + curve: Curves.ease, + ); + } } } } else { @@ -286,7 +289,11 @@ class TopicPictureBloc extends Bloc { } void _playResultSound(bool isCorrect) async { - await audioPlayer.stop(); + // await audioPlayer.stop(); + if (audioPlayer.state == PlayerState.playing && _isResultSoundPlaying == false) { + _voicePlayState = VoicePlayState.stop; + } + debugPrint("_playResultSound isCorrect=$isCorrect"); _isResultSoundPlaying = true; _forbiddenWhenCorrect = isCorrect; if (isCorrect) {