startTimer method
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(() {});
});
}