57 lines
1.5 KiB
Dart
57 lines
1.5 KiB
Dart
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"],
|
|
);
|
|
} |