代码示例
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
...
}