ConversationState class
Represents the state of a conversation with expiry support.
Constructors
- ConversationState.new({required String conversationName, required bool isActive, required DateTime lastUpdated, DateTime? expiresAt})
-
Creates a conversation state.
const
-
ConversationState.fromJson(Map<
String, dynamic> json) -
Creates a conversation state from JSON.
factory
Properties
- conversationName → String
-
Name of the conversation function.
final
- expiresAt → DateTime?
-
When the conversation expires (optional, defaults to lastUpdated + defaultTimeout).
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- isActive → bool
-
Whether the conversation is currently active.
final
- lastUpdated → DateTime
-
When the conversation was last updated.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
copyWith(
{String? conversationName, bool? isActive, DateTime? lastUpdated, DateTime? expiresAt}) → ConversationState - Creates a copy of this state with updated fields.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> - Converts the conversation state to JSON.
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited