Update AppUser Objecct to cater for all fields.

enable file generation of med cert
This commit is contained in:
2024-06-25 17:21:39 +02:00
parent fce5380390
commit 2fa2191a5f
23 changed files with 251 additions and 79 deletions

View File

@@ -1,15 +1,39 @@
class AppUser {
final int idusers;
final String email;
final int idUser;
final String UserName;
final int docOffice_id;
final String fname;
final String lname;
final String title;
const AppUser(
this.idusers,
this.email,
this.docOffice_id,
);
const AppUser({
required this.idUser,
required this.UserName,
required this.docOffice_id,
required this.fname,
required this.lname,
required this.title,
});
factory AppUser.fromJson(dynamic json) {
return AppUser(json['idusers'], json['email'], json['docOffice_id']);
factory AppUser.fromJson(Map<String, dynamic> json) {
return switch (json) {
{
'idUser': int idUser,
'UserName': String UserName,
'docOffice_id': int docOffice_id,
'fname': String fname,
'lname': String lname,
'title': String title,
} =>
AppUser(
idUser: idUser,
UserName: UserName,
docOffice_id: docOffice_id,
fname: fname,
lname: lname,
title: title,
),
_ => throw const FormatException('Failed to load album.'),
};
}
}

View File

@@ -0,0 +1,47 @@
class Patient2 {
final int idpatients;
final String id_no;
final String first_name;
final String last_name;
final String email;
final String cell_no;
final String medical_aid_name;
final String medical_aid_no;
final String medical_aid_scheme;
final String address;
final int doc_office_id;
const Patient2(
this.idpatients,
this.id_no,
this.first_name,
this.last_name,
this.email,
this.cell_no,
this.medical_aid_name,
this.medical_aid_no,
this.medical_aid_scheme,
this.address,
this.doc_office_id,
);
factory Patient2.fromJson(dynamic json) {
return Patient2(
json['idpatients'],
json['id_no'],
json['first_name'],
json['last_name'],
json['email'],
json['cell_no'],
json['medical_aid_name'],
json['medical_aid_no'],
json['medical_aid_scheme'],
json['address'],
json['docOffice_id'],
);
}
String getIDNum() {
return id_no;
}
}