debounce method Null safety

Future debounce(
  1. Function func

allows you to control events being triggered successively and, if the interval between two sequential occurrences is less than a certain amount of time (e.g. one second), it completely ignores the first one.


Future<dynamic> debounce(Function func) async {
  if (_waiter?.isActive ?? false) {
  _isReady = false;
  _waiter = Timer(_duration, () {
    _isReady = true;
    _resultSC.sink.add(Function.apply(func, []));