Initial commit: Penyerahan final Source code Tugas Akhir
This commit is contained in:
57
lib/models/update_incomplete_profile_model.dart
Normal file
57
lib/models/update_incomplete_profile_model.dart
Normal file
@ -0,0 +1,57 @@
|
||||
class UpdateIncompleteProfileModel {
|
||||
UpdateIncompleteProfileModel({
|
||||
this.status,
|
||||
this.error,
|
||||
this.messages,
|
||||
});
|
||||
|
||||
int? status;
|
||||
bool? error;
|
||||
dynamic messages;
|
||||
|
||||
factory UpdateIncompleteProfileModel.fromJson(Map<String, dynamic> json) {
|
||||
UpdateIncompleteProfileModel updateIncompleteProfileModel;
|
||||
try {
|
||||
updateIncompleteProfileModel = UpdateIncompleteProfileModel(
|
||||
status: json["status"],
|
||||
error: json["error"],
|
||||
messages: json["status"] == 200
|
||||
? json["data"]["messages"]
|
||||
: json["status"] == 404
|
||||
? json["message"]
|
||||
: MessagesOfIncompleteProfileModel.fromJson(json["data"]["message"])
|
||||
);
|
||||
} catch(e) {
|
||||
updateIncompleteProfileModel = UpdateIncompleteProfileModel(
|
||||
status: json["status"],
|
||||
error: json["error"],
|
||||
messages: json["data"]["message"]
|
||||
);
|
||||
}
|
||||
return updateIncompleteProfileModel;
|
||||
}
|
||||
}
|
||||
|
||||
class MessagesOfIncompleteProfileModel {
|
||||
MessagesOfIncompleteProfileModel({
|
||||
this.fullname,
|
||||
this.phone,
|
||||
this.datebirth,
|
||||
this.email,
|
||||
this.gender,
|
||||
});
|
||||
|
||||
String? fullname;
|
||||
String? phone;
|
||||
String? datebirth;
|
||||
String? email;
|
||||
String? gender;
|
||||
|
||||
factory MessagesOfIncompleteProfileModel.fromJson(Map<String, dynamic> json) => MessagesOfIncompleteProfileModel(
|
||||
fullname: json["full_name"],
|
||||
phone: json["phone"],
|
||||
datebirth: json["datebirth"],
|
||||
email: json["email"],
|
||||
gender: json["jenis_kel"],
|
||||
);
|
||||
}
|
Reference in New Issue
Block a user