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