InlineMethodFeedback.fromJson constructor
InlineMethodFeedback.fromJson(
- JsonDecoder jsonDecoder,
- String jsonPath,
- Object? json
)
Implementation
factory InlineMethodFeedback.fromJson(
JsonDecoder jsonDecoder, String jsonPath, Object? json) {
json ??= {};
if (json is Map) {
String? className;
if (json.containsKey('className')) {
className =
jsonDecoder.decodeString('$jsonPath.className', json['className']);
}
String methodName;
if (json.containsKey('methodName')) {
methodName = jsonDecoder.decodeString(
'$jsonPath.methodName', json['methodName']);
} else {
throw jsonDecoder.mismatch(jsonPath, 'methodName');
}
bool isDeclaration;
if (json.containsKey('isDeclaration')) {
isDeclaration = jsonDecoder.decodeBool(
'$jsonPath.isDeclaration', json['isDeclaration']);
} else {
throw jsonDecoder.mismatch(jsonPath, 'isDeclaration');
}
return InlineMethodFeedback(methodName, isDeclaration,
className: className);
} else {
throw jsonDecoder.mismatch(jsonPath, 'inlineMethod feedback', json);
}
}