ResponseMessage.fromJson constructor
ResponseMessage.fromJson(
- Map<String, dynamic> json, {
- bool isMarkdown = false,
})
Implementation
factory ResponseMessage.fromJson(Map<String, dynamic> json, {bool isMarkdown = false}) {
return ResponseMessage(
_parseMessageType(json['responseType']),
DateTime.now(), // Provide the current timestamp
responseType: json['responseType'],
text: (json['text'] != null && json['text']['text'] != null)
? json['text']['text'][0]
: null,
wholeResponsePayload: json['wholeResponsePayload'],
);
}