|
|
@ -33,6 +33,7 @@ class QuestionBloc extends Bloc<QuestionEvent, QuestionState> { |
|
|
) : super(QuestionState()) { |
|
|
) : super(QuestionState()) { |
|
|
volumeStream = _mainAudioService.volumeStream(); |
|
|
volumeStream = _mainAudioService.volumeStream(); |
|
|
playingStream = _mainAudioService.playingStream(); |
|
|
playingStream = _mainAudioService.playingStream(); |
|
|
|
|
|
// LocalStorage.saveData(key: MyConstants.firstShowcase, value: 'false'); |
|
|
initAudios(); |
|
|
initAudios(); |
|
|
registerShowCase(); |
|
|
registerShowCase(); |
|
|
on<GetLevelEvent>(_getLevelEvent); |
|
|
on<GetLevelEvent>(_getLevelEvent); |
|
|
@ -82,6 +83,12 @@ class QuestionBloc extends Bloc<QuestionEvent, QuestionState> { |
|
|
onStart: (showcaseIndex, key) { |
|
|
onStart: (showcaseIndex, key) { |
|
|
LocalStorage.saveData(key: MyConstants.firstShowcase, value: 'true'); |
|
|
LocalStorage.saveData(key: MyConstants.firstShowcase, value: 'true'); |
|
|
}, |
|
|
}, |
|
|
|
|
|
onDismiss: (onDismiss) async { |
|
|
|
|
|
await playQuestionAudio(); |
|
|
|
|
|
}, |
|
|
|
|
|
onFinish: () async { |
|
|
|
|
|
await playQuestionAudio(); |
|
|
|
|
|
}, |
|
|
); |
|
|
); |
|
|
} catch (_) {} |
|
|
} catch (_) {} |
|
|
} |
|
|
} |
|
|
@ -237,10 +244,15 @@ class QuestionBloc extends Bloc<QuestionEvent, QuestionState> { |
|
|
currentQuestion: data.questions?.first, |
|
|
currentQuestion: data.questions?.first, |
|
|
showAnswers: true |
|
|
showAnswers: true |
|
|
)); |
|
|
)); |
|
|
await playQuestionAudio(); |
|
|
|
|
|
|
|
|
if(LocalStorage.readData(key: MyConstants.firstShowcase) != 'true'){ |
|
|
|
|
|
await Future.delayed(Duration(milliseconds: 500)); |
|
|
animationController.forward().then((value) { |
|
|
animationController.forward().then((value) { |
|
|
startShowcase(); |
|
|
startShowcase(); |
|
|
}); |
|
|
}); |
|
|
|
|
|
} else { |
|
|
|
|
|
await playQuestionAudio(); |
|
|
|
|
|
animationController.forward(); |
|
|
|
|
|
} |
|
|
}, |
|
|
}, |
|
|
(error) { |
|
|
(error) { |
|
|
emit(state.copyWith(getQuestionStatus: BaseError(error.errorMessage))); |
|
|
emit(state.copyWith(getQuestionStatus: BaseError(error.errorMessage))); |
|
|
|