toJson method

Map<String, dynamic> toJson()

Serializes this instance to a JSON-compatible map.

Used internally, not intended for direct use by consumers. The map structure may change without notice.

Implementation

Map<String, dynamic> toJson() {
  final Map<String, dynamic> json = <String, dynamic>{};
  if (type != null) {
    json['type'] = type!.id;
  }
  if (value != null) {
    if (type == ValueType.list) {
      json['value'] = (value as ParameterList).pointerId;
    } else {
      json['value'] = value;
    }
  }
  if (name != null) {
    json['name'] = name;
  }
  if (key != null) {
    json['key'] = key;
  }
  return json;
}