step 9 : listing history scan dan pull to refresh, perbaikan auth model add host

This commit is contained in:
sindhu
2025-02-15 22:04:19 +07:00
parent 32abcb60dc
commit e90c710333
10 changed files with 378 additions and 122 deletions

View File

@@ -1,14 +1,17 @@
class AuthModel {
final String token;
final String host;
final UserModel model;
AuthModel({
required this.host,
required this.token,
required this.model,
});
Map<String, dynamic> toJson() {
return {
'host':host,
'token': token,
'model': model.toJson(),
};

View File

@@ -0,0 +1,41 @@
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,
};
}
}