42 lines
983 B
Dart
42 lines
983 B
Dart
class PersonKtp {
|
|
final String personID;
|
|
final String personNIK;
|
|
final String personName;
|
|
final String personDob;
|
|
final String personSex;
|
|
final String personUrl;
|
|
|
|
PersonKtp({
|
|
required this.personID,
|
|
required this.personNIK,
|
|
required this.personName,
|
|
required this.personDob,
|
|
required this.personSex,
|
|
required this.personUrl,
|
|
});
|
|
|
|
// Convert JSON to Model
|
|
factory PersonKtp.fromJson(Map<String, dynamic> json) {
|
|
return PersonKtp(
|
|
personID: json['Person_ID'],
|
|
personNIK: json['Person_NIK'],
|
|
personName: json['Person_Name'],
|
|
personDob: json['Person_Dob'],
|
|
personSex: json['Person_Sex'],
|
|
personUrl: json['Person_Url'],
|
|
);
|
|
}
|
|
|
|
// Convert Model to JSON
|
|
Map<String, dynamic> toJson() {
|
|
return {
|
|
'Person_ID':personID,
|
|
'Person_NIK': personNIK,
|
|
'Person_Name': personName,
|
|
'Person_Dob': personDob,
|
|
'Person_Sex': personSex,
|
|
'Person_Url': personUrl,
|
|
};
|
|
}
|
|
}
|