From 7f594fbb41ab5c9dc96e4eda496c045e42283e65 Mon Sep 17 00:00:00 2001 From: Sikander Saleem Date: Tue, 17 Jun 2025 10:08:24 +0300 Subject: [PATCH] timer tab switch issue fixed. --- ios/Podfile.lock | 4 ++-- .../swipe_module/utils/swipe_general_utils.dart | 2 +- lib/views/widgets/timer/app_timer.dart | 10 +++++++--- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 64268431..ffbf5eb6 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -332,7 +332,7 @@ SPEC CHECKSUMS: flutter_sound: dde9a913063b65a27ba8fdc2039036b99b136c79 flutter_sound_core: 0c6eb9d5268adc70ff159b3d65fd3d98a82d3a27 flutter_timezone: ffb07bdad3c6276af8dada0f11978d8a1f8a20bb - fluttertoast: e9a18c7be5413da53898f660530c56f35edfba9c + fluttertoast: 723e187574b149e68e63ca4d39b837586b903cfa FMDB: 728731dd336af3936ce00f91d9d8495f5718a0e6 geolocator_apple: 9bcea1918ff7f0062d98345d238ae12718acfbc1 GoogleDataTransport: aae35b7ea0c09004c3797d53c8c41f66f219d6a7 @@ -368,4 +368,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: d8654c27146ad2b7c852fbdd93ef1a3785d9310b -COCOAPODS: 1.16.2 +COCOAPODS: 1.12.0 diff --git a/lib/new_views/swipe_module/utils/swipe_general_utils.dart b/lib/new_views/swipe_module/utils/swipe_general_utils.dart index 8f4f03ae..d437b1b6 100644 --- a/lib/new_views/swipe_module/utils/swipe_general_utils.dart +++ b/lib/new_views/swipe_module/utils/swipe_general_utils.dart @@ -405,7 +405,7 @@ class SwipeGeneralUtils { }, context)); } if (kDebugMode) { - userProvider.user!.enableWifi != true; + userProvider.user!.enableWifi = true; } if (userProvider.user!.enableWifi!) { diff --git a/lib/views/widgets/timer/app_timer.dart b/lib/views/widgets/timer/app_timer.dart index 85cf14d3..c6acf250 100644 --- a/lib/views/widgets/timer/app_timer.dart +++ b/lib/views/widgets/timer/app_timer.dart @@ -17,7 +17,7 @@ class AppTimer extends StatefulWidget { final BoxDecoration? decoration; final bool enabled; final String? label; - final double ?width; + final double? width; final Function(bool)? timerProgress; @@ -98,8 +98,12 @@ class _AppTimerState extends State { _endAt = widget.timer?.endAt; _running = _startAt != null && _endAt == null; _delay = widget.timer?.durationInSecond ?? 0; - final difference = _startAt == null ? 0 : (_endAt ?? DateTime.now()).difference(_startAt!).inSeconds; + int difference = _startAt == null ? 0 : (_endAt ?? DateTime.now()).difference(_startAt!).inSeconds; + if (difference != 0 && _delay != 0) { + difference = difference + _delay; + } _period.value = Duration(seconds: _running ? difference : (difference != 0 ? difference : _delay)).toString().split(".").first; + super.initState(); if (_running) { _startTimer(); @@ -115,7 +119,7 @@ class _AppTimerState extends State { @override Widget build(BuildContext context) { return Container( - width: widget.width??100 * AppStyle.getScaleFactor(context), + width: widget.width ?? 100 * AppStyle.getScaleFactor(context), height: 56.toScreenHeight, padding: EdgeInsets.symmetric(horizontal: 16.toScreenWidth), decoration: widget.decoration ??