AgentConfigs.fromJson constructor
AgentConfigs.fromJson(
- Map<String, dynamic> json
)
Implementation
factory AgentConfigs.fromJson(Map<String, dynamic> json) {
return AgentConfigs(
image: json['image'],
displayName: json['display_name'],
description: json['description'],
customQuestions: (json['custom_questions'] as List<dynamic>?)
?.map((e) => e as String)
.toList(),
isSpeech2Text: json['is_speech2text'],
languages: (json['languages'] as List<dynamic>?)
?.map((e) => e as String) // Convert list of strings
.toList(),
colors: (json['colors'] as Map<String, dynamic>?)?.map((key,value)=>MapEntry(key, value as String)),
);
}