factory BaseMessage.fromJsonWithChat(Chat chat, Map<String, dynamic> json) { return BaseMessage.fromJson(json)..set(chat); }