call method

void call(
  1. void callback()
)

Calls the provided callback function with debouncing.

The callback parameter is a function that you want to debounce. The debounced function will be called after the specified delay has passed, and if subsequent calls are made within the delay period, the timer will be reset.

Example Usage:

// Call a function and debounce its execution.
debounce(() {
  // Your function logic here.
});

Implementation

void call(void Function() callback) {
  _timer?.cancel();
  _timer = Timer(delay, callback);
}