copyWith method

  1. @override
InputFieldBlocState<Value, ExtraData> copyWith({
  1. bool? isValueChanged,
  2. Param<Value>? initialValue,
  3. Param<Value>? updatedValue,
  4. Param<Value>? value,
  5. Param<Object?>? error,
  6. bool? isDirty,
  7. Param<Suggestions<Value>?>? suggestions,
  8. bool? isValidated,
  9. bool? isValidating,
  10. Param<FormBloc?>? formBloc,
  11. Param<ExtraData?>? extraData,
})
override

Returns a copy of the current state by changing the values that are passed as parameters.

Implementation

@override
InputFieldBlocState<Value, ExtraData> copyWith({
  bool? isValueChanged,
  Param<Value>? initialValue,
  Param<Value>? updatedValue,
  Param<Value>? value,
  Param<Object?>? error,
  bool? isDirty,
  Param<Suggestions<Value>?>? suggestions,
  bool? isValidated,
  bool? isValidating,
  Param<FormBloc?>? formBloc,
  Param<ExtraData?>? extraData,
}) {
  return InputFieldBlocState(
    isValueChanged: isValueChanged ?? this.isValueChanged,
    initialValue: initialValue.or(this.initialValue),
    updatedValue: updatedValue.or(this.updatedValue),
    value: value == null ? this.value : value.value,
    error: error == null ? this.error : error.value,
    isDirty: isDirty ?? this.isDirty,
    suggestions: suggestions == null ? this.suggestions : suggestions.value,
    isValidated: isValidated ?? this.isValidated,
    isValidating: isValidating ?? this.isValidating,
    formBloc: formBloc == null ? this.formBloc : formBloc.value,
    name: name,
    toJson: _toJson,
    extraData: extraData == null ? this.extraData : extraData.value,
  );
}