debounce method
Debounce during delay.
Implementation
void debounce(VoidCallback debounceFunction) {
if (timer?.isActive ?? false) timer?.cancel();
timer = Timer(delay ?? const Duration(milliseconds: 1000), () {
debounceFunction.call();
});
}