startTimer method

void startTimer({
  1. int refreshMilliSecond = 1000,
})

Implementation

void startTimer({int refreshMilliSecond = 1000}) {
  if (isRefreshStarted) {
    return;
  }
  this.refreshMilliSecond = refreshMilliSecond;
  isRefreshStarted = true;
  _cancelTimer();
  _everySecond = Timer.periodic(Duration(milliseconds: refreshMilliSecond), (Timer t) {
    if (!mounted) {
      return;
    }

    if (refreshSecondfunction != null) {
      refreshSecondfunction!();
    }

    setState(() {});
  });
}