Initial commit: Penyerahan final Source code Tugas Akhir
This commit is contained in:
51
lib/models/comment_qna_model.dart
Normal file
51
lib/models/comment_qna_model.dart
Normal file
@ -0,0 +1,51 @@
|
||||
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,
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user