Flutter Timer用法,延时执行

代码示例

const timeout = const Duration(seconds:3);
const ms= const Duration(milliseconds:1);

startTimeOut([int milliseconds]){
	var duration = milliseconds==null?timeout :milliseconds*ms
	return new Timer(duration ,handleTimeout)
}

void handleTimeout(){   //callback
...
}
    原文作者:Mavolas
    原文地址: https://blog.csdn.net/Mavolas/article/details/88431727
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞