periodic method
定时 @params milliSeconds 每多少毫秒执行回调一次
Implementation
Timer periodic(int milliSeconds, void Function(Timer timer) callback) {
final timer = Timer.periodic(milliSeconds.toMilliSeconds, (t) {
if (mounted) {
callback(t);
}
});
_addTimerSubscription(timer);
return timer;
}