ChangeContentOverlay.fromJson constructor
ChangeContentOverlay.fromJson(})
Implementation
factory ChangeContentOverlay.fromJson(
JsonDecoder jsonDecoder,
String jsonPath,
Object? json, {
ClientUriConverter? clientUriConverter,
}) {
json ??= {};
if (json is Map) {
if (json['type'] != 'change') {
throw jsonDecoder.mismatch(jsonPath, "equal to 'change'", json);
}
List<SourceEdit> edits;
if (json.containsKey('edits')) {
edits = jsonDecoder.decodeList(
'$jsonPath.edits',
json['edits'],
(String jsonPath, Object? json) => SourceEdit.fromJson(
jsonDecoder,
jsonPath,
json,
clientUriConverter: clientUriConverter,
),
);
} else {
throw jsonDecoder.mismatch(jsonPath, "'edits'", json);
}
int? version;
if (json.containsKey('version')) {
version = jsonDecoder.decodeInt('$jsonPath.version', json['version']);
}
return ChangeContentOverlay(edits, version: version);
} else {
throw jsonDecoder.mismatch(jsonPath, "'ChangeContentOverlay'", json);
}
}