CancellationToken class

A token that allows cancellation of in-flight AI requests.

Pass this to ConversationManager.send() or AIBridge.complete() to enable cancellation from the UI or timeout logic.

final token = CancellationToken();
// Later...
token.cancel(); // cancels the in-flight request

Constructors

CancellationToken()

Properties

hashCode int
The hash code for this object.
no setterinherited
isCancelled bool
Whether cancellation has been requested.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

cancel() → void
Cancel the associated operation.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
throwIfCancelled() → void
Throws CancelledException if cancellation has been requested.
toString() String
A string representation of this object.
inherited

Operators

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