updateInitialValue method

void updateInitialValue(
  1. Value value
)

Set value to the value and set isInitial to true of the current state.

Implementation

void updateInitialValue(Value value) {
  if (!_canUpdateValue(value: value, isInitialValue: true)) return;

  final error = _getError(value: value);
  final isValidating = _getAsyncValidatorsError(value: value, error: error);

  emit(state.copyWith(
    value: Param(value),
    initialValue: Param(value),
    updatedValue: Param(value),
    error: Param(error),
    isDirty: false,
    isValueChanged: false,
    isValidated: _isValidated(isValidating),
    isValidating: isValidating,
  ) as State);
}