FormFieldState<T> constructor

FormFieldState<T>({
  1. required T value,
  2. String? error,
  3. required String label,
  4. bool touched = false,
  5. bool validateOnUpdate = true,
  6. List<ValidationRule<T>> rules = const [],
})

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 [],
});