52 lines
1.0 KiB
Dart
52 lines
1.0 KiB
Dart
class Comment {
|
|
Comment({
|
|
this.idRep,
|
|
this.sender,
|
|
this.username,
|
|
this.textRep,
|
|
this.fotoProfile,
|
|
this.createAt,
|
|
});
|
|
|
|
String? idRep;
|
|
String? sender;
|
|
String? username;
|
|
String? textRep;
|
|
String? fotoProfile;
|
|
String? createAt;
|
|
|
|
factory Comment.fromJson(Map<String, dynamic> json) => Comment(
|
|
idRep: json["id_rep"],
|
|
sender: json["sender"],
|
|
username: json["username"],
|
|
textRep: json["text_rep"],
|
|
fotoProfile: json["foto_profile"],
|
|
createAt: json["create_at"],
|
|
);
|
|
|
|
Map<String, dynamic> toJson() => {
|
|
"id_rep": idRep,
|
|
"sender": sender,
|
|
"username": username,
|
|
"text_rep": textRep,
|
|
"foto_profile": fotoProfile,
|
|
"create_at": createAt,
|
|
};
|
|
}
|
|
|
|
class LikeModels {
|
|
LikeModels({
|
|
this.userId,
|
|
});
|
|
|
|
bool? userId;
|
|
|
|
factory LikeModels.fromJson(Map<String, dynamic> json) => LikeModels(
|
|
userId: json["user_id"].length > 0,
|
|
);
|
|
|
|
Map<String, dynamic> toJson() => {
|
|
"id_rep": userId,
|
|
};
|
|
}
|