From f0129399e6751f94b222babbb0aad25406caa00b Mon Sep 17 00:00:00 2001 From: FaizHashmiCS22 Date: Thu, 27 Oct 2022 12:38:52 +0300 Subject: [PATCH] Resolved issue in Release mode --- lib/provider/dashboard_provider_model.dart | 1 + lib/ui/login/login_screen.dart | 2 +- lib/ui/marathon/marathon_intro_screen.dart | 74 +++++++++++----------- lib/ui/marathon/marathon_provider.dart | 15 +++-- lib/ui/marathon/marathon_screen.dart | 2 +- lib/ui/marathon/widgets/question_card.dart | 30 ++++----- 6 files changed, 61 insertions(+), 63 deletions(-) diff --git a/lib/provider/dashboard_provider_model.dart b/lib/provider/dashboard_provider_model.dart index 26060ea..964dab8 100644 --- a/lib/provider/dashboard_provider_model.dart +++ b/lib/provider/dashboard_provider_model.dart @@ -123,6 +123,7 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin { List? getOpenNotificationsList; MohemmITGPendingTaskResponseItem? cocCount; int cocFinalCount = 0; + //Work List API's & Methods Future fetchWorkListCounter(context, {bool showLoading = false}) async { try { diff --git a/lib/ui/login/login_screen.dart b/lib/ui/login/login_screen.dart index 8cd93e4..4a7b659 100644 --- a/lib/ui/login/login_screen.dart +++ b/lib/ui/login/login_screen.dart @@ -140,7 +140,7 @@ class _LoginScreenState extends State { Widget build(BuildContext context) { if (isAppOpenBySystem == null) { isAppOpenBySystem = (ModalRoute.of(context)!.settings.arguments ?? true) as bool; - if (kDebugMode) { + if (kReleaseMode) { // username.text = "15444"; // Maha User username.text = "15153"; // Tamer User password.text = "Abcd@12345"; diff --git a/lib/ui/marathon/marathon_intro_screen.dart b/lib/ui/marathon/marathon_intro_screen.dart index 4a1a2b6..9ccf5b0 100644 --- a/lib/ui/marathon/marathon_intro_screen.dart +++ b/lib/ui/marathon/marathon_intro_screen.dart @@ -178,47 +178,45 @@ class MarathonFooter extends StatelessWidget { }) : super(key: key); Widget buildNoteForDemo() { - return Flexible( - child: RichText( - text: TextSpan( - children: [ - TextSpan( - text: LocaleKeys.note.tr(), - style: const TextStyle( - color: MyColors.darkTextColor, - fontSize: 17, - letterSpacing: -0.64, - fontWeight: FontWeight.bold, - ), + return RichText( + text: TextSpan( + children: [ + TextSpan( + text: LocaleKeys.note.tr(), + style: const TextStyle( + color: MyColors.darkTextColor, + fontSize: 17, + letterSpacing: -0.64, + fontWeight: FontWeight.bold, ), - TextSpan( - text: " " + LocaleKeys.demoMarathonNoteP1.tr(), - style: const TextStyle( - color: MyColors.grey77Color, - fontSize: 17, - letterSpacing: -0.64, - fontWeight: FontWeight.w500, - ), + ), + TextSpan( + text: " " + LocaleKeys.demoMarathonNoteP1.tr(), + style: const TextStyle( + color: MyColors.grey77Color, + fontSize: 17, + letterSpacing: -0.64, + fontWeight: FontWeight.w500, ), - TextSpan( - text: " " + LocaleKeys.demoMarathonNoteP2.tr(), - style: const TextStyle( - color: MyColors.darkTextColor, - fontSize: 17, - fontWeight: FontWeight.bold, - ), + ), + TextSpan( + text: " " + LocaleKeys.demoMarathonNoteP2.tr(), + style: const TextStyle( + color: MyColors.darkTextColor, + fontSize: 17, + fontWeight: FontWeight.bold, ), - TextSpan( - text: " " + LocaleKeys.demoMarathonNoteP3.tr(), - style: const TextStyle( - color: MyColors.grey77Color, - fontSize: 17, - letterSpacing: -0.64, - fontWeight: FontWeight.w500, - ), - ) - ], - ), + ), + TextSpan( + text: " " + LocaleKeys.demoMarathonNoteP3.tr(), + style: const TextStyle( + color: MyColors.grey77Color, + fontSize: 17, + letterSpacing: -0.64, + fontWeight: FontWeight.w500, + ), + ) + ], ), ).paddingOnly(right: 21, left: 21, top: 11, bottom: 0); } diff --git a/lib/ui/marathon/marathon_provider.dart b/lib/ui/marathon/marathon_provider.dart index 50a7bd2..39958c2 100644 --- a/lib/ui/marathon/marathon_provider.dart +++ b/lib/ui/marathon/marathon_provider.dart @@ -55,11 +55,13 @@ class MarathonProvider extends ChangeNotifier { timer.cancel(); cancelTimer(); isMarathonCompleted = true; - await Future.delayed(const Duration(seconds: 3)); - Navigator.pushReplacementNamed( - context, - AppRoutes.marathonWinnerSelection, + await Future.delayed(const Duration(seconds: 3)).whenComplete( + () => Navigator.pushReplacementNamed( + context, + AppRoutes.marathonWinnerSelection, + ), ); + resetValues(); return; @@ -77,8 +79,9 @@ class MarathonProvider extends ChangeNotifier { void resetValues() { timerU.cancel(); - isMarathonCompleted = false; - currentQuestionNumber = 1; + _isMarathonCompleted = false; + _currentQuestionNumber = 1; + notifyListeners(); } void cancelTimer() { diff --git a/lib/ui/marathon/marathon_screen.dart b/lib/ui/marathon/marathon_screen.dart index 2d7acee..445d72a 100644 --- a/lib/ui/marathon/marathon_screen.dart +++ b/lib/ui/marathon/marathon_screen.dart @@ -29,7 +29,7 @@ class MarathonScreen extends StatelessWidget { child: Column( children: [ const MarathonHeader(), - 20.height, + 20.height, MarathonProgressContainer(provider: provider) .paddingOnly(left: 21, right: 21), if (provider.isMarathonCompleted) diff --git a/lib/ui/marathon/widgets/question_card.dart b/lib/ui/marathon/widgets/question_card.dart index 08c9e3b..45fa6cc 100644 --- a/lib/ui/marathon/widgets/question_card.dart +++ b/lib/ui/marathon/widgets/question_card.dart @@ -135,9 +135,7 @@ class AnswerContent extends StatelessWidget { final DummyQuestionModel question; final MarathonProvider provider; - const AnswerContent( - {Key? key, required this.question, required this.provider}) - : super(key: key); + const AnswerContent({Key? key, required this.question, required this.provider}) : super(key: key); @override Widget build(BuildContext context) { @@ -170,20 +168,18 @@ class AnswerContent extends StatelessWidget { provider.startTimer(context); provider.swipeCardLeft(); }, - child: Flexible( - child: Container( - height: 60, - width: MediaQuery.of(context).size.width - 75, - alignment: Alignment.centerLeft, - decoration: MyDecorations.answerContainerDecoration, - child: Center( - child: Text( - question.opt1!, - style: const TextStyle( - color: MyColors.darkTextColor, - fontWeight: FontWeight.w600, - fontSize: 16, - ), + child: Container( + height: 60, + width: MediaQuery.of(context).size.width - 75, + alignment: Alignment.centerLeft, + decoration: MyDecorations.answerContainerDecoration, + child: Center( + child: Text( + question.opt1!, + style: const TextStyle( + color: MyColors.darkTextColor, + fontWeight: FontWeight.w600, + fontSize: 16, ), ), ),