toJson method

Map<String, Object?> toJson()

Implementation

Map<String, Object?> toJson() => {
  'id': id,
  'label': label,
  if (description != null) 'description': description,
  if (fields.isNotEmpty) 'fields': [for (var f in fields) f.toJson()],
};