Debounce class
A utility class for debouncing function calls.
Debouncing ensures that a function is only executed after a certain amount of time has passed since the last time it was invoked.
Example:
final debounced = Debounce(Duration(milliseconds: 300));
debounced(() => print('Called after 300ms of inactivity'));
Properties
Methods
-
call(
void action()) → void -
Executes the
actionafter the delay, canceling any pending execution. -
cancel(
) → void - Cancels any pending execution.
-
copyWith(
{Duration? delay}) → Debounce - Creates a copy of this Debounce with the given fields replaced.
-
dispose(
) → void - Disposes of the debounce instance and cancels any pending timers.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited