diff --git a/lib/core/widgets/dialog/hadith_dialog.dart b/lib/core/widgets/dialog/hadith_dialog.dart index 6be10d6..4fd64bd 100644 --- a/lib/core/widgets/dialog/hadith_dialog.dart +++ b/lib/core/widgets/dialog/hadith_dialog.dart @@ -67,13 +67,12 @@ class HadithDialog extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.stretch, children: [ Text.rich( - textDirection: TextDirection.rtl, TextSpan( text: '${hadith[index].narratorName ?? ''}:\n', style: MYTextStyle.titr1.copyWith( color: const Color(0XFF494178), - height: isArabic ? 1.8 : 1, + height: isArabic ? 1.8 : 1.05, fontFamily: MYTextStyle.notoSansArabic, ), children: [ diff --git a/lib/features/level/presentation/ui/level_page.dart b/lib/features/level/presentation/ui/level_page.dart index ffcefb3..94b7cc7 100644 --- a/lib/features/level/presentation/ui/level_page.dart +++ b/lib/features/level/presentation/ui/level_page.dart @@ -259,7 +259,7 @@ class _LevelPageState extends State { top: 0, right: 0, left: 0, - bottom: (comingSoon.bottom ?? 0) + 120, + bottom: (comingSoon.bottom ?? 0) + 174, child: _lockMapShadowCover(), ), Positioned( diff --git a/lib/features/question/presentation/bloc/question_bloc.dart b/lib/features/question/presentation/bloc/question_bloc.dart index 4a16558..9b37113 100644 --- a/lib/features/question/presentation/bloc/question_bloc.dart +++ b/lib/features/question/presentation/bloc/question_bloc.dart @@ -50,6 +50,7 @@ class QuestionBloc extends Bloc { imageAnimationController?.dispose(); globeAnimationController?.dispose(); scrollController.dispose(); + questionsScrollController.dispose(); PaintingBinding.instance.imageCache.clear(); PaintingBinding.instance.imageCache.clearLiveImages(); return super.close(); @@ -100,6 +101,7 @@ class QuestionBloc extends Bloc { AnimationController? imageAnimationController; AnimationController? globeAnimationController; final ScrollController scrollController = ScrollController(); + final ScrollController questionsScrollController = ScrollController(); int _nextSequenceToken() => ++_sequenceToken; @@ -193,8 +195,20 @@ class QuestionBloc extends Bloc { if (answers.isNotEmpty) { answers.removeWhere((e) => e.imageId == null); } - for (final answer in answers) { + for (int i = 0;i < answers.length; i++) { if (!_isActiveSequence(token)) return; + final answer = answers[i]; + // scroll to bottom to see answers better + final currentPixelsPosition = questionsScrollController.position.pixels; + final maxScrollExtent = questionsScrollController.position.maxScrollExtent; + if(i > 1 && currentPixelsPosition < + maxScrollExtent) { + questionsScrollController.animateTo( + maxScrollExtent, + duration: const Duration(milliseconds: 300), + curve: Curves.easeOut, + ); + } await Future.delayed(const Duration(milliseconds: 350), () async { if (_isActiveSequence(token) && MyContext.get.mounted) { await showAnswerDialog( @@ -347,6 +361,7 @@ class QuestionBloc extends Bloc { await Future.delayed(const Duration(milliseconds: 30)); if (!_isActiveSequence(token)) return; scrollController.jumpTo(0); + questionsScrollController.jumpTo(0); answerAnimationController?.reverse(); await Future.delayed(const Duration(seconds: 1), () async { if (!_isActiveSequence(token)) return; @@ -383,6 +398,7 @@ class QuestionBloc extends Bloc { if (!_isActiveSequence(token)) return; imageAnimationController?.forward(); scrollController.jumpTo(0); + questionsScrollController.jumpTo(0); changeGlobeState(key: MyAnimations.globeStateSpeaking); await playQuestionAudio(); if (!_isActiveSequence(token)) return; diff --git a/lib/features/question/presentation/ui/screens/question_screen.dart b/lib/features/question/presentation/ui/screens/question_screen.dart index 2d28ebc..a383dc0 100644 --- a/lib/features/question/presentation/ui/screens/question_screen.dart +++ b/lib/features/question/presentation/ui/screens/question_screen.dart @@ -172,7 +172,7 @@ class _QuestionScreenState extends State child: child, ), child: ListView( - controller: context.read().scrollController, + controller: context.read().questionsScrollController, padding: const EdgeInsets.only(top: 10), children: [ FadeAnimController( diff --git a/lib/l10n/app_localizations_id.dart b/lib/l10n/app_localizations_id.dart index 2d667ad..55d5f64 100644 --- a/lib/l10n/app_localizations_id.dart +++ b/lib/l10n/app_localizations_id.dart @@ -103,7 +103,7 @@ class AppLocalizationsId extends AppLocalizations { String get exit => 'Keluar'; @override - String get play => 'MAIN'; + String get play => 'Bermain '; @override String get no_hadith => 'Tidak ada Hadith untuk pertanyaan ini';