AnalysisErrorsParams.fromJson constructor
AnalysisErrorsParams.fromJson(})
Implementation
factory AnalysisErrorsParams.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<AnalysisError> errors;
if (json.containsKey('errors')) {
errors = jsonDecoder.decodeList(
'$jsonPath.errors',
json['errors'],
(String jsonPath, Object? json) => AnalysisError.fromJson(
jsonDecoder, jsonPath, json,
clientUriConverter: clientUriConverter));
} else {
throw jsonDecoder.mismatch(jsonPath, 'errors');
}
return AnalysisErrorsParams(file, errors);
} else {
throw jsonDecoder.mismatch(jsonPath, 'analysis.errors params', json);
}
}