ArcaneEnumField<T> constructor
const
ArcaneEnumField<T> ({
- Key? key,
- ArcaneEnumFieldType? mode,
- required List<
T> options, - Widget itemBuilder(
- BuildContext,
- T
- Widget cardBuilder(
- BuildContext,
- T,
- T
Constructs an ArcaneEnumField<T> instance with the specified configuration for enum selection.
This const constructor supports generic enum types T and initializes fields for mode, options, and builders.
The options list is required and drives the UI generation; mode can be null for auto-selection based
on length. Custom itemBuilder and cardBuilder allow flexible rendering, while the widget integrates
with ArcaneField<T> provider for state persistence. Defaults promote ease of use, e.g., auto-mode for
varying option counts, ensuring compatibility with form validation and theming in Arcane.
Implementation
const ArcaneEnumField(
{super.key,
this.mode,
required this.options,
this.itemBuilder,
this.cardBuilder});