You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
uco-mobile-poc/lib/app/models/AuthenticationResponse.dart

53 lines
1.6 KiB
Dart

class AuthenticationResponse {
String name = "";
String cmpCuststatus = "";
String cmpCustlastlogin = "";
String cmpCustcode = "";
// Role userRole = "";
String jwtToken = "";
String refreshToken = "";
bool isKycVerified = false;
AuthenticationResponse({
this.name = "",
this.cmpCuststatus = "",
this.cmpCustlastlogin = "",
this.cmpCustcode = "",
//this.userRole = "",
this.jwtToken = "",
this.refreshToken = "",
this.isKycVerified = false,
});
Map<String, dynamic> toMap() {
return {
'name': name,
'cmpCuststatus': cmpCuststatus,
'cmpCustlastlogin': cmpCustlastlogin,
'cmpCustcode': cmpCustcode,
//'userRole': userRole.toMap(), // Assuming Role has a toMap method
'jwtToken': jwtToken,
'refreshToken': refreshToken,
'isKycVerified': isKycVerified,
};
}
factory AuthenticationResponse.fromMap(Map<String, dynamic> map) {
return AuthenticationResponse(
name: map['name'] ?? "",
cmpCuststatus: map['cmpCuststatus'] ?? "",
cmpCustlastlogin: map['cmpCustlastlogin'] ?? "",
cmpCustcode: map['cmpCustcode'] ?? "",
// userRole: Role.fromMap(map['userRole']), // Assuming Role has a fromMap method
jwtToken: map['jwtToken'] ?? "",
refreshToken: map['refreshToken'] ?? "",
isKycVerified: map['isKycVerified'] ?? "",
);
}
@override
String toString() {
return 'AuthenticationResponse{name: $name, cmpCuststatus: $cmpCuststatus, cmpCustlastlogin: $cmpCustlastlogin, cmpCustcode: $cmpCustcode, /*userRole: userRole,*/ jwtToken: $jwtToken, refreshToken: $refreshToken, isKycVerified: $isKycVerified}';
}
}