SmartDebouncer<T> class
A smart debouncer that coalesces bursts of calls into deterministic actions.
The debouncer supports leading/trailing execution, optional maxWait,
pausing, flushing, and async-aware error handling.
Constructors
- SmartDebouncer({required Duration delay, bool leading = false, bool trailing = true, Duration? maxWait, void onError(Object error, StackTrace st)?, void onLeadingInvoke()?})
Properties
Methods
-
call(
DebounceCallback< T> action) → Future<T?> -
Schedules
actionaccording to debounce semantics. -
cancel(
) → void - Cancels any pending trailing invocation and completes waiting futures.
-
dispose(
) → void - Disposes the debouncer, cancelling timers and rejecting further calls.
-
flush(
) → Future< T?> - Flushes the pending trailing action, if any, executing it immediately.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
pause(
) → void - Pauses the timers, freezing the countdown.
-
resume(
) → void - Resumes timers that were previously paused.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited