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 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');
}
return ChangeContentOverlay(edits);
} else {
throw jsonDecoder.mismatch(jsonPath, 'ChangeContentOverlay', json);
}
}