ArcaneInput class

A utility class providing static factory methods to create specialized ArcaneField instances for common input types in the Arcane UI component system. This class simplifies the creation of form fields for handling user input such as colors, dates, times, booleans, enums, and text. It integrates with the Form and FieldWrapper components to provide a consistent form-building experience in Flutter applications using the Arcane framework.

Key features:

  • Supports direct getter/setter providers for reactive data binding.
  • Configurable metadata for field labeling and icons.
  • Specialized builders for each input type, ensuring proper UI rendering and interaction.
  • Defaults to PromptMode.popover for non-intrusive input dialogs.

Usage example:

ArcaneInput.text(
  name: 'Username',
  getter: () => _usernameFuture(),
  setter: (value) => _setUsername(value),
)

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

checkbox({String? name, String? description, IconData? icon, bool defaultValue = false, required Future<bool> getter(), required Future setter(bool)}) ArcaneField
Creates a boolean checkbox input field for toggling true/false values. This simple toggle widget is ideal for binary options in forms, integrating seamlessly with FieldWrapper and Form in the Arcane UI ecosystem for consistent boolean input handling.
color({String? name, String? description, IconData? icon, Color? defaultValue, required Future<Color> getter(), required Future setter(Color), PromptMode mode = PromptMode.popover, Widget? dialogTitle, AlignmentGeometry? popoverAlignment, AlignmentGeometry? popoverAnchorAlignment, EdgeInsetsGeometry? popoverPadding, bool? showAlpha, bool? allowPickFromScreen, Duration writeThrottle = const Duration(seconds: 1)}) ArcaneField
Creates a color input field that allows users to select and set a Color value. This field uses a color picker interface, supporting popover or dialog modes for selection. It fits into the Arcane form system by providing visual color input with optional alpha channel and screen picking capabilities, often wrapped in a FieldWrapper for consistent styling.
date({String? name, String? description, IconData? icon, DateTime? defaultValue, required Future<DateTime> getter(), required Future setter(DateTime), PromptMode mode = PromptMode.popover, CalendarViewType? initialViewType, Widget? dialogTitle, CalendarView? initialView, AlignmentGeometry? popoverAlignment, AlignmentGeometry? popoverAnchorAlignment, EdgeInsetsGeometry? popoverPadding, DateStateBuilder? stateBuilder}) ArcaneField
Creates a date input field for selecting and setting DateTime values. This field integrates a calendar view for date selection, supporting popover or full dialog modes. It is designed for use within Form components in the Arcane UI system, allowing customization of the initial calendar view and state building for dynamic date displays.
select<T>({String? name, String? description, IconData? icon, ArcaneEnumFieldType? mode, Widget itemBuilder(BuildContext, T)?, Widget cardBuilder(BuildContext, T, T)?, required T defaultValue, required List<T> options, required Future<T> getter(), required Future setter(T)}) ArcaneField
Creates an enum selection field for choosing from a list of values. Supports various modes like dropdown or cards, with customizable builders for items and cards. This field is a core part of Arcane's form input system, allowing typed selection within Form widgets, often wrapped by FieldWrapper for enhanced UX.
selectCards<T>({String? name, String? description, IconData? icon, Widget itemBuilder(BuildContext, T)?, Widget cardBuilder(BuildContext, T, T)?, required T defaultValue, required List<T> options, required Future<T> getter(), required Future setter(T)}) ArcaneField
Convenience method to create a card-based enum selection field. Delegates to select with ArcaneEnumFieldType.cards mode, displaying enum options as selectable cards for a more visual selection experience in Arcane UI forms.
selectDropdown<T>({String? name, String? description, IconData? icon, Widget itemBuilder(BuildContext, T)?, Widget cardBuilder(BuildContext, T, T)?, required T defaultValue, required List<T> options, required Future<T> getter(), required Future setter(T)}) ArcaneField
Convenience method to create a dropdown-style enum selection field. Delegates to select with ArcaneEnumFieldType.dropdown mode, providing a compact dropdown menu for enum choices in Arcane forms.
text({String? name, String? description, IconData? icon, String? placeholder, int? minLines, int? maxLines, String defaultValue = "", required Future<String> getter(), required Future setter(String)}) ArcaneField<String>
Creates a text input field for string values, supporting single or multi-line input. This is a fundamental text entry widget in the Arcane form system, configurable for line constraints and placeholders, typically used within FieldWrapper for labeled inputs.
textArea({String? name, String? description, IconData? icon, String? placeholder, int? minLines = 3, int? maxLines = 6, String defaultValue = "", required Future<String> getter(), required Future setter(String)}) ArcaneField<String>
Convenience method for creating a multi-line text area input. Delegates to text with default min/max lines suitable for longer text entry, ideal for descriptions or notes in Arcane forms.
time({String? name, String? description, IconData? icon, DateTime? defaultValue, required Future<DateTime> getter(), required Future setter(DateTime), PromptMode mode = PromptMode.popover, ValueChanged<TimeOfDay?>? onChanged, AlignmentGeometry? popoverAlignment, AlignmentGeometry? popoverAnchorAlignment, EdgeInsetsGeometry? popoverPadding, bool? use24HourFormat, bool showSeconds = false, Widget? dialogTitle}) ArcaneField
Creates a time input field for selecting and setting DateTime values focused on time components. This field uses a time picker interface, configurable for 12/24-hour format and seconds display. It complements date fields in Form setups within the Arcane component library, enabling precise time entry via popover or dialog.