Timer
创建
Timer _timer = new Timer.periodic(duration, (Timer timer){
if(...) {
timer.cancel();
}
});
cancel
@override
void dispose() {
_timer?.cancel();
super.dispose();
}
Timer _timer = new Timer.periodic(duration, (Timer timer){
if(...) {
timer.cancel();
}
});
@override
void dispose() {
_timer?.cancel();
super.dispose();
}
本文标题:Flutter Timer创建循环执行 与取消
本文链接:https://www.haomeiwen.com/subject/muhziktx.html
网友评论