debounce method
Implementation
void debounce(Duration duration, void Function() callback) {
timer?.cancel();
timer = Timer(duration, () {
timer?.cancel();
callback();
});
}
void debounce(Duration duration, void Function() callback) {
timer?.cancel();
timer = Timer(duration, () {
timer?.cancel();
callback();
});
}