FlutterCountdownTimer icon indicating copy to clipboard operation
FlutterCountdownTimer copied to clipboard

How can we restart the CountdownTimer

Open panchalAlpit opened this issue 5 years ago • 5 comments

how can we restart the timer in between time counting? I mean is it possible to restart the timer.

panchalAlpit avatar Feb 12 '21 13:02 panchalAlpit

Update endTime.

    setState(() {
            endTime = DateTime.now().millisecondsSinceEpoch + 1000 * 30;
          });

wuweijian1997 avatar Feb 13 '21 03:02 wuweijian1997

Thanks now it's working.

panchalAlpit avatar Feb 15 '21 07:02 panchalAlpit

it's not working in Bottomsheet. I have checked the Get.bottomSheet(). and showModalBottomSheet().

panchalAlpit avatar Feb 15 '21 07:02 panchalAlpit

May I have a look at your code?Minimum runnable code that does not work.

wuweijian1997 avatar Feb 15 '21 15:02 wuweijian1997

@wuweijian1997 it cannot be restarted if it has ended, because it gets disposed, could we maybe add a property whether or not to dispose when it ends? that will allow us to restart the timer once it has ended (and yes dispose in that case should be manual).

netgfx avatar Mar 24 '21 13:03 netgfx