NavigationRegion.fromJson constructor
NavigationRegion.fromJson(})
Implementation
factory NavigationRegion.fromJson(
JsonDecoder jsonDecoder,
String jsonPath,
Object? json, {
ClientUriConverter? clientUriConverter,
}) {
json ??= {};
if (json is Map) {
int offset;
if (json.containsKey('offset')) {
offset = jsonDecoder.decodeInt('$jsonPath.offset', json['offset']);
} else {
throw jsonDecoder.mismatch(jsonPath, "'offset'", json);
}
int length;
if (json.containsKey('length')) {
length = jsonDecoder.decodeInt('$jsonPath.length', json['length']);
} else {
throw jsonDecoder.mismatch(jsonPath, "'length'", json);
}
List<int> targets;
if (json.containsKey('targets')) {
targets = jsonDecoder.decodeList(
'$jsonPath.targets',
json['targets'],
jsonDecoder.decodeInt,
);
} else {
throw jsonDecoder.mismatch(jsonPath, "'targets'", json);
}
return NavigationRegion(offset, length, targets);
} else {
throw jsonDecoder.mismatch(jsonPath, "'NavigationRegion'", json);
}
}