Message.fromJson constructor

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

Implementation

factory Message.fromJson(Map<String, dynamic> json) {
  const JsonEncoder encoder = JsonEncoder();
  final dynamic sender = encoder.convert(json['sender']);

  return Message(
      id: json['id'],
      name: json['name'],
      created: json['created'],
      displayName: json['displayName'],
      lastUpdated: json['lastUpdated'],
      dirty: json['dirty'],
      text: json['text'],
      sender: sender.toString(),
      messageConversation: json['messageConversation']);
}