CancelableCallback class
A scheduled callback that is invoked like a function and can also be cancelled.
Invoke it (handle()) to schedule the wrapped action per the
debounce/throttle policy; call cancel to drop any pending timer — e.g. when
the owning widget or controller is disposed — so the action does not fire
after teardown and the underlying Timer does not leak. The plain debounce
and throttle closures expose no such handle.
Constructors
- CancelableCallback(void _schedule(), void _cancel())
-
Wraps the
_schedule(invoke) and_cancel(drop-pending) actions. Audited: 2026-06-13
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
-
call(
) → void - Schedules the wrapped action per the debounce/throttle policy. Audited: 2026-06-13
-
cancel(
) → void - Cancels any pending invocation. Safe to call more than once. Audited: 2026-06-13
-
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