MessageConversation.fromJson constructor

MessageConversation.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory MessageConversation.fromJson(Map<String, dynamic> json) {
  return MessageConversation(
      id: json['id'],
      name: json['name'],
      subject: json['subject'],
      created: json['created'],
      displayName: json['displayName'],
      lastUpdated: json['lastUpdated'],
      dirty: json['dirty'],
      status: json['status'],
      messageType: json['messageType'],
      read: json['read'],
      lastMessage: json['lastMessage'],
      messages: (json['messages'] ?? [])
          .map<Message>((message) => Message.fromJson({
                ...message,
                'dirty': false,
                'messageConversation': json['id']
              }))
          .toList());
}