Debounce class

A static class for handling method call debouncing.

Constructors

Debounce()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

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

Static Methods

cancel(String tag) → void
Cancels any active debounce operation with the given tag.
cancelAll() → void
Cancels all active debouncers.
count() int
Returns the number of active debouncers (debouncers that haven't yet called their onExecute methods).
debounce(String tag, Duration duration, DebounceCallback onExecute) → void
Will delay the execution of onExecute with the given duration. If another call to debounce() with the same tag happens within this duration, the first call will be cancelled and the debouncer will start waiting for another duration before executing onExecute.
fire(String tag) → void
Fires the callback associated with tag immediately. This does not cancel the debounce timer, so if you want to invoke the callback and cancel the debounce timer, you must first call fire(tag) and then cancel(tag).