timer tab switch issue fixed.

design_3.0_task_module_new
Sikander Saleem 5 months ago
parent b29284f59f
commit 7f594fbb41

@ -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

@ -405,7 +405,7 @@ class SwipeGeneralUtils {
}, context));
}
if (kDebugMode) {
userProvider.user!.enableWifi != true;
userProvider.user!.enableWifi = true;
}
if (userProvider.user!.enableWifi!) {

@ -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<AppTimer> {
_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<AppTimer> {
@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 ??

Loading…
Cancel
Save