CompletionGetSuggestionDetailsResult.fromJson constructor
CompletionGetSuggestionDetailsResult.fromJson()
Implementation
factory CompletionGetSuggestionDetailsResult.fromJson(
JsonDecoder jsonDecoder, String jsonPath, Object? json) {
json ??= {};
if (json is Map) {
String completion;
if (json.containsKey('completion')) {
completion = jsonDecoder.decodeString(
'$jsonPath.completion', json['completion']);
} else {
throw jsonDecoder.mismatch(jsonPath, 'completion');
}
SourceChange? change;
if (json.containsKey('change')) {
change = SourceChange.fromJson(
jsonDecoder, '$jsonPath.change', json['change']);
}
return CompletionGetSuggestionDetailsResult(completion, change: change);
} else {
throw jsonDecoder.mismatch(
jsonPath, 'completion.getSuggestionDetails result', json);
}
}