debounceInput static method
录入框防抖 (传入所要防抖的方法/回调与延迟时间)
Implementation
static debounceInput(Function(dynamic) func, [int delay = 500]) {
Timer? timer;
return (dynamic value) {
if (timer != null) {
timer?.cancel();
}
timer = Timer(Duration(milliseconds: delay), () {
func.call(value);
timer = null;
});
};
}