AuthenticationCheck.fromJson constructor Null safety
Implementation
AuthenticationCheck.fromJson(Map<String, dynamic> json) {
result = json['result'] ?? '';
isAuthenticated = json['isAuthenticated'] ?? false;
roles = [];
if (json['roles'] != null) {
json['roles'].forEach((e) {
roles.add(e);
});
}
if (json['permissions'] != null) {
json['permissions'].forEach((e) {
roles.add(e);
});
}
}