class SingleChatModelClass { SingleChatModelClass({ required this.from, required this.to, required this.message, required this.seen, required this.isDeleted, required this.isHide, required this.isPin, required this.id2, required this.id, }); String from = ""; String to = ""; String message = ""; bool seen = false; bool isDeleted = false; bool isHide = false; bool isPin = false; String id2 = ""; String id = ""; SingleChatModelClass.fromJson(Map json){ from = json['from'] ?? ""; to = json['to'] ?? ""; message = json['message'] ?? ""; seen = json['seen'] ?? false; isDeleted = json['isDeleted'] ?? false; isHide = json['isHide'] ?? false; isPin = json['isPin'] ?? false; id2 = json['_id'] ?? ""; id = json['id'] ?? ""; } Map toJson() { final data = {}; data['from'] = from; data['to'] = to; data['message'] = message; data['seen'] = seen; data['isDeleted'] = isDeleted; data['isHide'] = isHide; data['isPin'] = isPin; data['_id'] = id2; data['id'] = id; return data; } @override String toString() { return 'SingleChatModelClass{from: $from, to: $to, message: $message, seen: $seen, isDeleted: $isDeleted, isHide: $isHide, isPin: $isPin, id2: $id2, id: $id}'; } }