forms library

Form state, validation-aware attributes, and reusable form widgets.

Import this library when a consuming app needs draft handling, validation-aware controls, or form-specific helpers built on top of the DraftModeFramework form foundations.

Classes

DraftModeForm
Thin wrapper around Flutter's Form that wires in DraftMode draft handling.
DraftModeFormAttribute<T>
Mutable form-facing attribute that keeps a committed value, validation metadata, and synchronous normalizers together.
DraftModeFormButton
Form-aware submit button that validates and saves a linked form before running the provided callback.
DraftModeFormButtonText
DraftModeFormCalendar
Two-ended calendar/date-time range widget built from reusable form controls.
DraftModeFormController
Lightweight draft/value controller reused by DraftModeFormState.
DraftModeFormDateTime
Reusable date/time form control backed by the shared UI date/time component.
DraftModeFormDependencyContext
Extended validation context that tracks cross-field dependencies.
DraftModeFormDropDown<ItemType, ValueType>
DraftModeFormField<T>
DraftModeFormFieldState<T>
DraftModeFormFormatter<T>
Shared formatter interface used by DraftMode form fields.
DraftModeFormList<ItemType>
Form-oriented list wrapper used by selection flows such as dropdown pickers.
DraftModeFormNumberFormatter<T extends num>
Locale-style numeric formatter used by typed form fields.
DraftModeFormSegmentedControl<T extends Object>
Form-aware wrapper around DraftModeUISegmentedControl.
DraftModeFormState
Concrete FormState implementation with draft tracking and per-attribute validation orchestration.
DraftModeFormStateI
DraftModeFormSwitch
DraftModeFormTypeDouble
DraftModeFormTypeDoubleSigned
DraftModeFormTypeInt
DraftModeFormTypeIntSigned
DraftModeFormValueContext
Form-specific alias for the shared validation value context contract.
DraftModeTypedValidator<T>
Validator wrapper that carries stable metadata alongside the callable.
DraftModeUIDateTime
Native-looking inline date/time control with iOS-style day-grid selection.
DraftModeUIDateTimeController
Controller used to coordinate which date/time panel is currently expanded.
DraftModeValidationAfter
Raised when a value must be after a comparison date/time.
DraftModeValidationAfterOrEqual
Raised when a value must be after or equal to a comparison date/time.
DraftModeValidationDependencyContext
Extended validation context that can optionally track dependencies.
DraftModeValidationGreaterThan
Raised when a value must be greater than a comparison value.
DraftModeValidationIssue
Structured validation issue that resolves to localized text in the UI layer while still remaining usable in non-UI workflows.
DraftModeValidationMaxLength
Raised when a string exceeds the allowed length.
DraftModeValidationRequired
Raised when a required value is missing.
DraftModeValidationValueContext
Context used by reusable validation contracts to inspect related values without depending on a specific runtime like forms or repositories.

Enums

DraftModeUIDateTimeMinuteInterval
Minute granularity used by DraftModeUIDateTime.
DraftModeUIDateTimeMode
Display modes supported by DraftModeUIDateTime.
DraftModeUIDateTimePanel
Expansion panels available on the inline date/time control.
DraftModeValidatorType
Known validator families supported by DraftMode validation contracts.

Functions

lookupTypedValidator<T>(DraftModeValidator<T> validator) DraftModeTypedValidator<T>?
vAfter(dynamic compare) DraftModeValidator<DateTime>
Returns a validator that requires DateTime values to be after compare.
vAfterOrEqual(dynamic compare) DraftModeValidator<DateTime>
Returns a validator that requires DateTime values to be after or equal to compare.
vGreaterThan<T>(dynamic compare) DraftModeValidator<T>
Returns a validator that requires values to be greater than compare.
vMaxLen(int length) DraftModeValidator<String>
Returns a validator that rejects strings longer than length.
vRequired<T>() DraftModeValidator<T>
Returns a validator that rejects null and blank string values.
vRequiredOn<T>(dynamic compareAttribute) DraftModeValidator<T>
Returns a validator that requires a value when compareAttribute is true.

Typedefs

DraftModeFormCalendarHourSteps = DraftModeUIDateTimeMinuteInterval
DraftModeFormCalendarMode = DraftModeUIDateTimeMode
Legacy aliases kept on the forms surface for form-centric consumers.
DraftModeFormListItemBuilder<ItemType> = Widget Function(ItemType item, bool isSelected)
DraftModeValidator<T> = DraftModeValidationIssue? Function(DraftModeValidationValueContext? context, T? value)
Signature for validators used by field definitions and form attributes.