Debouncer class
A small utility to debounce function execution.
Constructors
- Debouncer({int? milliseconds, Duration? duration})
-
Creates a debouncer with the provided
millisecondsordurationdelay. - Debouncer.duration(Duration duration)
-
Creates a debouncer with the provided
durationdelay.factory
Properties
- delay → Duration
-
Debounce delay duration.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- isPending → bool
-
Whether a debounced action is currently scheduled.
no setter
- milliseconds → int
-
Debounce delay in milliseconds.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
cancel(
) → void - Alias for dispose.
-
dispose(
) → void - Cancels any pending action.
-
flush(
) → void - Immediately executes any pending action and cancels the timer.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
run(
void action()) → void -
Schedules
action, replacing any pending action. -
runAsync<
T> (FutureOr< T> action()) → Future<T> -
Schedules
actionand returns its eventual result. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited