CallbackDelayer class

Waits for duration before running a callback.

Use case: Collecting and aggregating input from a Futter TextField while the user is typing and only processing the input after duration.

Inheritance

Constructors

CallbackDelayer({required Duration duration})

Properties

current TimeStampedCallbackControllerState
The current state.
getter/setter pairinherited
duration Duration
After the event delaying is added the stream will wait for at least duration before the event CallbackControllerState.ready is added.
finalinherited
hashCode int
The hash code for this object.
no setterinherited
hasTimedOut bool
Returns true if the last state added to stream was delaying and DateTime.now is after current.dateTimeStamp plus duration.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stream Stream<CallbackControllerState>
A stream with events of type CallbackControllerState.
no setterinherited

Methods

close() Future
Closes the controller such that no further events will be added to stream. Any unfinished timers will be cancelled.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
run(FutureOr<void> callback()) FutureOr<void>
Delays running callback.
override
runAsync(FutureOr<void> callback()) Future<void>
Delays the runnign of callback and emits events in the following sequence:
override
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited