toJson method

  1. @override
Map<String, dynamic> toJson()
override

Implementation

@override
Map<String, dynamic> toJson() {
  return {
    'name': name,
    'description': description,
    'type': type.value,
    'required': isRequired,
    'choices':
        choices.map((e) => {'name': e.name, 'value': e.value}).toList(),
  };
}