Message.fromMap constructor

Message.fromMap(
  1. Map<String, dynamic>? map
)

Implementation

factory Message.fromMap(Map<String, dynamic>? map) {
  if (map == null) return Message();

  return Message(
      id: map['id'],
      time: map['time'],
      message: map['message'],
      type: MessageType.values[map['type']],
      contentType: MessageContentTypeExt.fromIndex(map['content_type'] ?? 0),
      sender: map['sender'],
      imageData: map['imageData'] ?? Uint8List(0));
}