ResponseMessage.fromJson constructor

ResponseMessage.fromJson(
  1. Map<String, dynamic> json, {
  2. 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'],

  );
}