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.'),
};
}
}