ArcaneEnumField<T> constructor

const ArcaneEnumField<T>({
  1. Key? key,
  2. ArcaneEnumFieldType? mode,
  3. required List<T> options,
  4. Widget itemBuilder(
    1. BuildContext,
    2. T
    )?,
  5. Widget cardBuilder(
    1. BuildContext,
    2. T,
    3. 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});