I have UI like this, and we can see timer running in my apps.
And here's code of the timer :
TimerCountdown(
onEnd: () {
getTrxResponse();
setState((){});
if (trxStatus.contains('Pending')) {
failedUpdate();
setState((){});
}
},
enableDescriptions: false,
format: CountDownTimerFormat.hoursMinutesSeconds,
endTime: now.add(
const Duration(hours: 00, minutes: 30, seconds: 00)),
timeTextStyle: const TextStyle(
color: Colors.black45,
fontWeight: FontWeight.bold,
fontSize: 12),
colonsTextStyle: const TextStyle(
color: Colors.black,
fontWeight: FontWeight.bold,
fontSize: 8),
spacerWidth: 2,
),
The target is when the timer on End will updating status transaction, then if status still 'Pending' app will sent failed transaction to backend.
The problem is when the apps get force closed by user, it will make the timer stop running and will not sent anything to backend.
Is there something I can do to make the timer running in background?
Or I used a wrong method?
