AnalysisOverridesParams.fromJson constructor
AnalysisOverridesParams.fromJson(
- JsonDecoder jsonDecoder,
- String jsonPath,
- Object? json
)
Implementation
factory AnalysisOverridesParams.fromJson(
JsonDecoder jsonDecoder, String jsonPath, Object? json) {
json ??= {};
if (json is Map) {
String file;
if (json.containsKey('file')) {
file = jsonDecoder.decodeString('$jsonPath.file', json['file']);
} else {
throw jsonDecoder.mismatch(jsonPath, 'file');
}
List<Override> overrides;
if (json.containsKey('overrides')) {
overrides = jsonDecoder.decodeList(
'$jsonPath.overrides',
json['overrides'],
(String jsonPath, Object? json) =>
Override.fromJson(jsonDecoder, jsonPath, json));
} else {
throw jsonDecoder.mismatch(jsonPath, 'overrides');
}
return AnalysisOverridesParams(file, overrides);
} else {
throw jsonDecoder.mismatch(jsonPath, 'analysis.overrides params', json);
}
}