AnalysisFoldingParams.fromJson constructor
AnalysisFoldingParams.fromJson(})
Implementation
factory AnalysisFoldingParams.fromJson(
JsonDecoder jsonDecoder, String jsonPath, Object? json,
{ClientUriConverter? clientUriConverter}) {
json ??= {};
if (json is Map) {
String file;
if (json.containsKey('file')) {
file = clientUriConverter?.fromClientFilePath(
jsonDecoder.decodeString('$jsonPath.file', json['file'])) ??
jsonDecoder.decodeString('$jsonPath.file', json['file']);
} else {
throw jsonDecoder.mismatch(jsonPath, 'file');
}
List<FoldingRegion> regions;
if (json.containsKey('regions')) {
regions = jsonDecoder.decodeList(
'$jsonPath.regions',
json['regions'],
(String jsonPath, Object? json) => FoldingRegion.fromJson(
jsonDecoder, jsonPath, json,
clientUriConverter: clientUriConverter));
} else {
throw jsonDecoder.mismatch(jsonPath, 'regions');
}
return AnalysisFoldingParams(file, regions);
} else {
throw jsonDecoder.mismatch(jsonPath, 'analysis.folding params', json);
}
}