LinkedEditGroup.fromJson constructor
LinkedEditGroup.fromJson(})
Implementation
factory LinkedEditGroup.fromJson(
JsonDecoder jsonDecoder,
String jsonPath,
Object? json, {
ClientUriConverter? clientUriConverter,
}) {
json ??= {};
if (json is! Map) {
throw jsonDecoder.mismatch(jsonPath, "'LinkedEditGroup'", json);
}
List<Position> positions;
if (json case {'positions': var encodedPositions}) {
positions = jsonDecoder.decodeList(
'$jsonPath.positions',
encodedPositions,
(String jsonPath, Object? json) => Position.fromJson(
jsonDecoder,
jsonPath,
json,
clientUriConverter: clientUriConverter,
),
);
} else {
throw jsonDecoder.mismatch(jsonPath, "'positions'", json);
}
int length;
if (json case {'length': var encodedLength}) {
length = jsonDecoder.decodeInt('$jsonPath.length', encodedLength);
} else {
throw jsonDecoder.mismatch(jsonPath, "'length'", json);
}
List<LinkedEditSuggestion> suggestions;
if (json case {'suggestions': var encodedSuggestions}) {
suggestions = jsonDecoder.decodeList(
'$jsonPath.suggestions',
encodedSuggestions,
(String jsonPath, Object? json) => LinkedEditSuggestion.fromJson(
jsonDecoder,
jsonPath,
json,
clientUriConverter: clientUriConverter,
),
);
} else {
throw jsonDecoder.mismatch(jsonPath, "'suggestions'", json);
}
return LinkedEditGroup(positions, length, suggestions);
}