debounce static method
Implementation
static debounce(
Function func, [
Duration delay = const Duration(milliseconds: 100),
]) {
Timer? timer;
return (val) {
if (timer != null) {
timer?.cancel();
}
timer = Timer(delay, () {
func(val);
});
};
}