builder property
A versatile wrapper widget for form fields within the Arcane UI component ecosystem.
This StatelessWidget integrates seamlessly with the Form system by leveraging ArcaneField and Pylon for reactive state management. It provides a consistent layout for displaying form field values, metadata (such as icons, names, and descriptions), and interactive content via a customizable builder. Key features include:
- Reactive rendering of field values from the Pylon provider, with support for nullable types.
- Visual validation feedback using an animated check icon that fades in on valid values and out after a delay.
- Loading state handling with a "Loading..." placeholder and shimmer animation.
- Flexible scaffolding: defaults to a ListTile for standard form field presentation but allows overriding with a custom Pylon widget for advanced layouts.
- Tight integration with ArcaneField.meta for displaying field-specific UI elements like icons and subtitles.
This wrapper is typically used within form sections or Section components to encapsulate individual fields, ensuring a polished and responsive user experience. It fits into the broader form architecture by consuming ArcaneFieldProvider for value retrieval and updates.
Example usage in a form context:
ArcaneFieldWrapper<String>(
builder: (value) => Text(value ?? 'Enter your name'),
overrideTileScaffold: false, // Use default ListTile
)
The builder callback responsible for constructing the interactive or display widget based on the current field value.
This function receives the resolved value of type T (or null if loading/unset) and must return a Widget representing the field's content, such as input fields, selectors, or custom UI elements. It enables dynamic rendering tied to the form's state via Pylon.
For example, it could render a TextField for editable strings or a DropdownButton for selections.
Implementation
final PylonBuilder builder;