InlineLocalVariableFeedback.fromJson constructor
InlineLocalVariableFeedback.fromJson(})
Implementation
factory InlineLocalVariableFeedback.fromJson(
JsonDecoder jsonDecoder,
String jsonPath,
Object? json, {
ClientUriConverter? clientUriConverter,
}) {
json ??= {};
if (json is Map) {
String name;
if (json.containsKey('name')) {
name = jsonDecoder.decodeString('$jsonPath.name', json['name']);
} else {
throw jsonDecoder.mismatch(jsonPath, 'name');
}
int occurrences;
if (json.containsKey('occurrences')) {
occurrences = jsonDecoder.decodeInt(
'$jsonPath.occurrences',
json['occurrences'],
);
} else {
throw jsonDecoder.mismatch(jsonPath, 'occurrences');
}
return InlineLocalVariableFeedback(name, occurrences);
} else {
throw jsonDecoder.mismatch(
jsonPath,
'inlineLocalVariable feedback',
json,
);
}
}