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