EnumField<T extends Enum> constructor

EnumField<T extends Enum>({
  1. Key? key,
  2. required List<T> values,
  3. String? label,
  4. void onChange(
    1. T?
    )?,
  5. void onEditingComplete()?,
  6. string? validator(
    1. T?
    )?,
  7. T? defaultValue,
  8. bool readOnly = false,
  9. Color? borderColor,
  10. TextAlign textAlign = TextAlign.start,
  11. FocusNode? focusNode,
  12. bool autofocus = false,
  13. IconData? icon,
  14. double? max,
  15. string itemAsString(
    1. T?
    )?,
})

Implementation

EnumField({
  super.key,
  required this.values,
  this.label,
  this.onChange,
  this.onEditingComplete,
  this.validator,
  this.defaultValue,
  this.readOnly = false,
  this.borderColor,
  this.textAlign = TextAlign.start,
  this.focusNode,
  this.autofocus = false,
  this.icon,
  this.max,
  this.itemAsString,
}) {
  if (values.isEmpty) {
    throw "EnumField: values cannot be empty";
  }
}