BouncyListener class

callback will be called after waiting for duration when input is called. If input is called again before duration is elapsed, the timer restarts. So calling input every 500ms during 2s with a duration of 1s will result in a total debounce of 3s.

Example :

TextEditingController.addListener(BouncyListener(callback, const Duration(milliseconds: 100))..input);

Constructors

BouncyListener(void callback(), Duration duration)

Properties

callback ↔ void Function()
getter/setter pair
duration Duration
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

cancel() → void
Cancels the currently waiting callback.
input() → void
Pass this to TextEditingController.addListener, for example.
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