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

hashCode int
The hash code for this object.
no setterinherited
isActive bool
Whether there is a pending invocation or one currently running.
no setter
isPaused bool
Whether timers are paused.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

call(DebounceCallback<T> action) Future<T?>
Schedules action according 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