RuntimeCompletionVariable.fromJson constructor
RuntimeCompletionVariable.fromJson(
- JsonDecoder jsonDecoder,
- String jsonPath,
- Object? json
)
Implementation
factory RuntimeCompletionVariable.fromJson(
JsonDecoder jsonDecoder, String jsonPath, Object? json) {
json ??= {};
if (json is Map) {
String name;
if (json.containsKey('name')) {
name = jsonDecoder.decodeString('$jsonPath.name', json['name']);
} else {
throw jsonDecoder.mismatch(jsonPath, 'name');
}
RuntimeCompletionExpressionType type;
if (json.containsKey('type')) {
type = RuntimeCompletionExpressionType.fromJson(
jsonDecoder, '$jsonPath.type', json['type']);
} else {
throw jsonDecoder.mismatch(jsonPath, 'type');
}
return RuntimeCompletionVariable(name, type);
} else {
throw jsonDecoder.mismatch(jsonPath, 'RuntimeCompletionVariable', json);
}
}