toJson method

Map<String, Object?> toJson()

Implementation

Map<String, Object?> toJson() => {
  'id': id,
  'label': label,
  'kind': kind.name,
  if (!required) 'required': false,
  if (description != null) 'description': description,
  if (defaultValue != null) 'default': defaultValue,
  if (options.isNotEmpty) 'options': [for (var o in options) o.toJson()],
  if (optionsFrom != null) 'optionsFrom': optionsFrom,
  if (repeatable) 'repeatable': true,
};