Authentication.fromJson constructor
Authentication.fromJson(
- Object? j
Implementation
factory Authentication.fromJson(Object? j) {
final json = j as Map<String, Object?>;
return Authentication(
rules: switch (json['rules']) {
null => [],
List<Object?> $1 => [
for (final i in $1) AuthenticationRule.fromJson(i),
],
_ => throw const FormatException('"rules" is not a list'),
},
providers: switch (json['providers']) {
null => [],
List<Object?> $1 => [for (final i in $1) AuthProvider.fromJson(i)],
_ => throw const FormatException('"providers" is not a list'),
},
);
}