FormState class
State for a Form component.
This manages states for text input, focus
and selection (single and multi).
- Implementers
Constructors
-
FormState(List<
FormConfig< _configValues)FormConfigOption> > -
FormState.multiScreen(List<
FormConfig< configValues)FormConfigOption> > -
Creates a FormState configured for a multi-screen
Form.factory
Properties
-
configurations
→ List<
FormConfig< FormConfigOption> > -
Mutable configurations which gets updated with this state.
final
- focusedConfigIndex → int
-
Index of the current configuration in focus.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- maxFocusedConfigIndex → int
-
Max index of focusable configurations.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
dispose(
) → void - Disposes all resources held by this state.
-
focusDown(
) → void - Moves focus to the next element vertically.
-
focusLeft(
) → void - Moves focus to the next element horizontally.
-
focusRight(
) → void - Moves focus to the previous element horizontally.
-
focusUp(
) → void - Moves focus to the previous element vertically.
-
getFocusedOptionIndexFor(
FormConfig< FormConfigOption> config) → int? -
Returns the focused option for
config. -
getInputControllerFor(
FormInputConfig config) → ValidatingTextController? -
Returns the ValidatingTextController for
config, if any. -
getInputFor(
FormInputConfig config) → String? -
Returns the current input text for
config, if any. -
getSelectedOptionFor<
T extends FormConfigOption> (FormConfig< T> config) → T? -
Returns the selected FormConfigOption for
config. For multi-select configs, use getSelectedOptionsFor instead. -
getSelectedOptionsFor<
T extends FormConfigOption> (FormConfig< T> config) → Set<T> ? -
Returns all selected FormConfigOptions for
config. -
isOptionSelectedForConfig<
T extends FormConfigOption> (FormConfig< T> config, T option) → bool -
Returns true if
optionis a selected option forconfig. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onSelect(
) → void - Selects the element that is in focus.
-
requestFocus(
FormConfig< FormConfigOption> config) → void -
Requests for
configto be in focus. -
selectConfigOption(
) → void - Updates the selected FormSelectionConfig for the focused FormConfig.
-
setValidator(
FormInputConfig config, String? validator(String)?) → void -
Sets a validator function for
configthat will run on every text change. The validator is persisted so it survives config removal and recreation when requirements are not met. -
toString(
) → String -
A string representation of this object.
inherited
-
updateFocusedConfig(
int delta) → void -
Updates the focused FormConfig by
delta. -
updateFocusedConfigOption(
int delta) → void -
Updates the focused FormConfigOption for the focused FormConfig by
delta. -
updateInput(
FormInputConfig config, String text) → void -
Updates the input text for
configwithtext. -
updateSelectedOption(
FormSelectionConfig< FormConfigOption> config, FormConfigOption option) → void -
Sets
optionas a selected value forconfig.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited