copyWith method

ValueAndErrorMessage<T, E> copyWith({
  1. T? value,
  2. E? validator(
    1. T value
    )?,
  3. bool? isVisible,
  4. bool? isEnabled,
  5. void onChanged(
    1. T value
    )?,
})

Implementation

ValueAndErrorMessage<T, E> copyWith({
  T? value,
  E? Function(T value)? validator,
  bool? isVisible,
  bool? isEnabled,
  void Function(T value)? onChanged,
}) {
  return ValueAndErrorMessage<T, E>(
    value: value ?? this.value,
    validator: validator ?? _validator,
    isVisible: (isVisible ?? this.isVisible),
    onChanged: onChanged ?? this.onChanged,
    isEnabled: isEnabled ?? this.isEnabled,
  );
}