Flutter解决按钮请求防重复提交【转】
onTap: (){
// 防重复提交
if(lastPopTime == null || DateTime.now().difference(lastPopTime) > Duration(seconds: 2)){
lastPopTime = DateTime.now();
_payOrder(context);
}else{
lastPopTime = DateTime.now();
MyUtils.showMessage("请勿重复点击!");
}
},