toJson method

Map<String, Object?> toJson()

Implementation

Map<String, Object?> toJson() => {
  'knob': name,
  if (label != null) 'label': label,
  if (description != null) 'description': description,
  if (options.isNotEmpty) 'options': options,
  if (from != null) 'from': from!.toJson(),
  if (required) 'required': true,
};