Debounce constructor Null safety

Debounce(
  1. Function _func,
  2. Duration wait,
  3. {bool leading = false,
  4. bool trailing = true,
  5. Duration? maxWait}
)

Creates a new instance of Debounce.

Implementation

Debounce(
  this._func,
  Duration wait, {
  bool leading = false,
  bool trailing = true,
  Duration? maxWait,
})  : _leading = leading,
      _trailing = trailing,
      _wait = wait.inMilliseconds,
      _maxing = maxWait != null {
  if (_maxing) {
    _maxWait = math.max(maxWait!.inMilliseconds, _wait);
  }
}