toJson method

Map<String, dynamic> toJson()

Converts the conversation state to JSON.

Implementation

Map<String, dynamic> toJson() {
  return {
    'conversationName': conversationName,
    'isActive': isActive,
    'lastUpdated': lastUpdated.toIso8601String(),
    if (expiresAt != null) 'expiresAt': expiresAt!.toIso8601String(),
  };
}