93 lines
2.6 KiB
Dart
93 lines
2.6 KiB
Dart
class InviteComModel {
|
|
InviteComModel({
|
|
required this.status,
|
|
required this.statusCode,
|
|
required this.message,
|
|
required this.data,
|
|
});
|
|
|
|
final String? status;
|
|
final int? statusCode;
|
|
final String? message;
|
|
final List<Datum> data;
|
|
|
|
factory InviteComModel.fromJson(Map<String, dynamic> json){
|
|
return InviteComModel(
|
|
status: json["status"],
|
|
statusCode: json["status_code"],
|
|
message: json["message"],
|
|
data: json["data"] == null ? [] : List<Datum>.from(json["data"]!.map((x) => Datum.fromJson(x))),
|
|
);
|
|
}
|
|
|
|
}
|
|
|
|
class Datum {
|
|
Datum({
|
|
required this.id,
|
|
required this.senderIamXid,
|
|
required this.communityXid,
|
|
required this.receiverIamXid,
|
|
required this.isAccepted,
|
|
required this.createdAt,
|
|
required this.updatedAt,
|
|
required this.deletedAt,
|
|
required this.community,
|
|
required this.senderDetail,
|
|
});
|
|
|
|
final int? id;
|
|
final int? senderIamXid;
|
|
final int? communityXid;
|
|
final int? receiverIamXid;
|
|
final int? isAccepted;
|
|
final DateTime? createdAt;
|
|
final DateTime? updatedAt;
|
|
final dynamic deletedAt;
|
|
final dynamic community;
|
|
final SenderDetail? senderDetail;
|
|
|
|
factory Datum.fromJson(Map<String, dynamic> json){
|
|
return Datum(
|
|
id: json["id"],
|
|
senderIamXid: json["sender_iam_xid"],
|
|
communityXid: json["community_xid"],
|
|
receiverIamXid: json["receiver_iam_xid"],
|
|
isAccepted: json["is_accepted"],
|
|
createdAt: DateTime.tryParse(json["created_at"] ?? ""),
|
|
updatedAt: DateTime.tryParse(json["updated_at"] ?? ""),
|
|
deletedAt: json["deleted_at"],
|
|
community: json["community"],
|
|
senderDetail: json["sender_detail"] == null ? null : SenderDetail.fromJson(json["sender_detail"]),
|
|
);
|
|
}
|
|
|
|
}
|
|
|
|
class SenderDetail {
|
|
SenderDetail({
|
|
required this.id,
|
|
required this.userName,
|
|
required this.fullName,
|
|
required this.profilePhoto,
|
|
required this.isUserPinned,
|
|
});
|
|
|
|
final int? id;
|
|
final String? userName;
|
|
final String? fullName;
|
|
final String? profilePhoto;
|
|
final bool? isUserPinned;
|
|
|
|
factory SenderDetail.fromJson(Map<String, dynamic> json){
|
|
return SenderDetail(
|
|
id: json["id"],
|
|
userName: json["user_name"],
|
|
fullName: json["full_name"],
|
|
profilePhoto: json["profile_photo"],
|
|
isUserPinned: json["is_user_pinned"],
|
|
);
|
|
}
|
|
|
|
}
|