GemParameter.fromJson constructor

GemParameter.fromJson(
  1. Map<String, dynamic> json
)

Deserializes a JSON-compatible map to create an instance.

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

Implementation

factory GemParameter.fromJson(final Map<String, dynamic> json) {
  final ValueType type = ValueTypeExtension.fromId(json['type']);
  dynamic value = json['value'];

  if (type == ValueType.list) {
    value = ParameterList.init(json['value']);
  }

  return GemParameter(
    type: ValueTypeExtension.fromId(json['type']),
    value: value,
    name: json['name'],
    key: json['key'],
  );
}