FormFieldState<T> constructor
FormFieldState<T> ({})
Creates a new instance of FormFieldState.
- value The initial value of the form field.
- error An optional error message initially associated with the field.
- label The label or name of the form field (required).
- touched Indicates whether the field has been touched (default is
false
). - validateOnUpdate Indicates whether validation should occur on updates (default is
true
). - rules The list of validation rules to apply to the form field (default is an empty list).
Implementation
FormFieldState({
required this.value,
this.error,
required this.label,
this.touched = false,
this.validateOnUpdate = true,
this.rules = const [],
});