timerTread static method

void timerTread()

定时关闭

Implementation

static void timerTread() {
  if (_timer != null && _timer!.isActive) {
    _timer!.cancel();
    _timer = null;
  }
  int index = 0;
  _timer = new Timer.periodic(new Duration(seconds: 1), (Timer timer) {
    index++;
    if (index >= 10) {
      index = 0;
      timer.cancel();
      dismiss();
    }
  });
}