debounce static method
dynamic
debounce(])
Implementation
static debounce(
Function(String text) fun, [
Duration delay = const Duration(milliseconds: 500),
]) {
Timer? timer;
return (String text) {
if (timer != null) {
timer?.cancel();
}
timer = Timer(delay, () {
fun(text);
});
};
}