EnumField<T extends Enum> constructor
EnumField<T extends Enum>({ - Key? key,
- required List<T> values,
- String? label,
- void onChange(
- T?
)?,
- void onEditingComplete()?,
- string? validator(
- T?
)?,
- T? defaultValue,
- bool readOnly = false,
- Color? borderColor,
- TextAlign textAlign = TextAlign.start,
- FocusNode? focusNode,
- bool autofocus = false,
- IconData? icon,
- double? max,
- string itemAsString(
- 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";
}
}