Debouncer class

A debouncer implementation that delays the execution of a function until a specified duration has passed.

Example:

final delayed = Debouncer(delay: Duration(seconds: 1));
print('The next function will be called after 1 second');
delayed(() => print('Called after 1 second'));

Constructors

Debouncer({required Duration delay})
Constructs a Debouncer with the specified delay duration.

Properties

delay Duration
The duration to delay the function execution.
final
hashCode int
The hash code for this object.
no setterinherited
isRunning bool
Returns true if a delayed call is currently active, otherwise false.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

call(void action()) → void
Calls the function after the specified delay duration.
cancel() → void
Cancels the current delayed call, if any.
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