countdown method

Future<void> countdown()

Implementation

Future<void> countdown() async { //print("Counting down");
  while (timeRemaining > 0) {
    await Future.delayed(Duration(milliseconds: widget.framerate)).then((value) {
      if (countingDown) {
        setState(() { timeRemaining -= widget.framerate; });
      }
    });
  } //countingDown = false;
}