SelectOption.fromJson constructor

SelectOption.fromJson(
  1. Map<String, dynamic> json,
  2. String path
)

Implementation

factory SelectOption.fromJson(Map<String, dynamic> json, String path) {
  final value = json['value'];
  if (value == null) {
    throw SchemaFormatException('$path.value', 'expected a value, got null');
  }
  return SelectOption(
    value: value as Object,
    label: req<String>(json, 'label', path),
  );
}