fromJson static method

MessageContent fromJson(
  1. Map<String, dynamic> messageMap
)

Implementation

static MessageContent fromJson(Map<String, dynamic> messageMap) {
  try {
    return MessageContent(
        senderId: messageMap['senderId'],
        msg: messageMap['msg'],
        dateTime: DateTime.parse(messageMap['dateTime']));
  } catch (e) {
    return MessageContent(
      senderId: messageMap['senderId'],
      msg: messageMap['msg'],
    );
  }
}