copyWith method
HiddenFieldState<T>
copyWith({
- T? value,
- String? error,
- String? label,
- bool? touched,
- bool? validateOnUpdate,
- List<
ValidationRule< ? rules,T> >
override
Creates a new FormFieldState object by copying the existing state and replacing the specified fields with new values.
This method returns a new object that has the same state as the current object, except with the updated fields.
value
The new value for the form field.
error
The new error string for the form field.
label
The new label string for the form field.
touched
The new boolean value indicating whether the field has been touched.
validateOnUpdate
The new boolean value to indicate whether to validate on update.
rules
The new list of ValidationRule objects for the form field.
Returns a new FormFieldState object with updated fields.
Implementation
@override
HiddenFieldState<T> copyWith({
T? value,
String? error,
String? label,
bool? touched,
bool? validateOnUpdate,
List<ValidationRule<T>>? rules,
}) {
return HiddenFieldState<T>(
value ?? this.value,
);
}