Chat class

Annotations

Constructors

Chat()

Properties

endedSessionId String?
The ended session id when in read-only mode (for card regeneration).
no setter
hashCode int
The hash code for this object.
no setterinherited
params ChatParams
latefinalinherited
ref NotifierProviderRef<ChatState>
The Ref from the provider associated with this Notifier.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sessionId String?
The active session id, if one has been created.
no setter
sessionStartedAt DateTime?
no setter
state ChatState
The value currently exposed by this Notifier.
getter/setter pairinherited
stateOrNull ChatState?
The value currently exposed by this Notifier.
no setterinherited

Methods

build(ChatParams params) ChatState
listenSelf(void listener(ChatState? previous, ChatState next), {void onError(Object error, StackTrace stackTrace)?}) → void
Listens to changes on the value exposed by this provider.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
restoreSession() Future<bool>
Restore ALL sessions for this topic+mode, merging their messages chronologically. If an active session exists, new messages go there. Otherwise the conversation is read-only.
sendMessage(String userMessage) Future<void>
Send a user message, call Claude, and update state.
setSessionId(String id) → void
Set the session id (e.g. after creating a LearningSession).
startNewSession() → void
Allow the user to continue the conversation in a new session. Keeps existing messages visible; next sendMessage creates a new session.
toString() String
A string representation of this object.
inherited
updateShouldNotify(ChatState previous, ChatState next) bool
A method invoked when the state exposed by this Notifier changes. It compares the previous and new value, and return whether listeners should be notified.
inherited

Operators

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