debounce method
void
debounce(})
Implementation
void debounce(
Debouncer<T> debounceFunction, {
Duration interval = const Duration(
milliseconds: 400,
),
}) {
Timer? timer;
on<T>(
(value) async {
if (timer != null) {
timer!.cancel();
}
timer = Timer(
interval,
() => debounceFunction(value),
);
},
);
}