This repository has been archived on 2024-10-18. You can view files and clone it, but cannot push or open issues or pull requests.
ftc_patient_app/lib/models/chat/single_chat.dart

53 lines
1.3 KiB
Dart

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<String, dynamic> 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<String, dynamic> toJson() {
final data = <String, dynamic>{};
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}';
}
}