update<T extends FormFieldState<G> , G> method
Updates the field value and status.
Parameters:
fieldName
The name of the field to update.value
The new value for the field.
Implementation
void update<T extends FormFieldState<G>, G>(String fieldName, G value) {
var field = state.get<T, G>(fieldName);
state.fields[fieldName] = field.copyWith(
value: value,
touched: true,
);
final status =
_allValid ? BondFormStateStatus.valid : BondFormStateStatus.invalid;
state = state.copyWith(
fields: Map.from(state.fields),
status: status,
);
}