EditListPostfixCompletionTemplatesResult.fromJson constructor
EditListPostfixCompletionTemplatesResult.fromJson()
Implementation
factory EditListPostfixCompletionTemplatesResult.fromJson(
JsonDecoder jsonDecoder, String jsonPath, Object? json) {
json ??= {};
if (json is Map) {
List<PostfixTemplateDescriptor> templates;
if (json.containsKey('templates')) {
templates = jsonDecoder.decodeList(
'$jsonPath.templates',
json['templates'],
(String jsonPath, Object? json) =>
PostfixTemplateDescriptor.fromJson(
jsonDecoder, jsonPath, json));
} else {
throw jsonDecoder.mismatch(jsonPath, 'templates');
}
return EditListPostfixCompletionTemplatesResult(templates);
} else {
throw jsonDecoder.mismatch(
jsonPath, 'edit.listPostfixCompletionTemplates result', json);
}
}