Errors.fromJson constructor
Errors.fromJson(
- Object? j
Implementation
factory Errors.fromJson(Object? j) {
final json = j as Map<String, Object?>;
return Errors(
code: switch (json['code']) {
null => null,
Object $1 => decodeString($1),
},
errorDetails: switch (json['errorDetails']) {
null => [],
List<Object?> $1 => [for (final i in $1) ErrorDetails.fromJson(i)],
_ => throw const FormatException('"errorDetails" is not a list'),
},
location: switch (json['location']) {
null => null,
Object $1 => decodeString($1),
},
message: switch (json['message']) {
null => null,
Object $1 => decodeString($1),
},
);
}