Browse Source

fix: globe animation and image show with delay

pull/62/head
AmirrezaChegini 5 days ago
parent
commit
e389933d0d
  1. 4
      lib/core/widgets/animations/globe_animation.dart
  2. 11
      lib/features/question/presentation/bloc/question_bloc.dart

4
lib/core/widgets/animations/globe_animation.dart

@ -25,8 +25,8 @@ class _GlobeAnimationState extends State<GlobeAnimation>
super.initState(); super.initState();
_controller = AnimationController( _controller = AnimationController(
vsync: this, vsync: this,
duration: const Duration(seconds: 1),
reverseDuration: const Duration(seconds: 1),
duration: const Duration(hours: 1),
reverseDuration: const Duration(hours: 1),
); );
_animation = Tween<double>( _animation = Tween<double>(
begin: 1, begin: 1,

11
lib/features/question/presentation/bloc/question_bloc.dart

@ -87,10 +87,10 @@ class QuestionBloc extends Bloc<QuestionEvent, QuestionState> {
// ); // );
// } // }
// Future<void> showImageWithDelayed() async {
// await Future.delayed(const Duration(milliseconds: 500));
// imageAnimationController?.forward();
// }
Future<void> showImageWithDelayed() async {
await Future.delayed(const Duration(milliseconds: 500));
imageAnimationController?.forward();
}
void showHadith({required BuildContext context}) { void showHadith({required BuildContext context}) {
showHadithDialog( showHadithDialog(
@ -240,6 +240,7 @@ class QuestionBloc extends Bloc<QuestionEvent, QuestionState> {
showAnswers: false, showAnswers: false,
correctAnswer: false, correctAnswer: false,
)); ));
showImageWithDelayed();
await playQuestionAudio(); await playQuestionAudio();
imageAnimationController?.reverse(); imageAnimationController?.reverse();
answerAnimationController?.forward().then((value) { answerAnimationController?.forward().then((value) {
@ -290,7 +291,7 @@ class QuestionBloc extends Bloc<QuestionEvent, QuestionState> {
} else { } else {
showingAnswerSequence(show: true); showingAnswerSequence(show: true);
await Future.delayed(const Duration(seconds: 1)); await Future.delayed(const Duration(seconds: 1));
imageAnimationController?.forward();
showImageWithDelayed();
scrollController.jumpTo(0); scrollController.jumpTo(0);
await playQuestionAudio(); await playQuestionAudio();
imageAnimationController?.reverse(); imageAnimationController?.reverse();

Loading…
Cancel
Save