AuthenticationCheck.fromJson constructor Null safety

AuthenticationCheck.fromJson(
  1. Map<String, dynamic> json
)

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);
    });
  }
}