copyWith method

  1. @override
DateMessage copyWith({
  1. String? after,
  2. String? any,
  3. String? before,
  4. String betweenDates(
    1. DateTime min,
    2. DateTime max
    )?,
  5. String? every,
  6. String? refine,
  7. String? required,
  8. ArrayMessage? array,
  9. String? weekday,
  10. String? weekend,
})
override

Creates a copy of the current DateMessage instance with updated values.

If a parameter is not provided, the existing value is retained.

Example

final defaultMessage = DateMessage();
final customMessage = defaultMessage.copyWith(after: 'Date should be later than expected');
print(customMessage.after); // Output: 'Date should be later than expected'

Implementation

@override
DateMessage copyWith({
  String? after,
  String? any,
  String? before,
  String Function(DateTime min, DateTime max)? betweenDates,
  String? every,
  String? refine,
  String? required,
  ArrayMessage? array,
  String? weekday,
  String? weekend,
}) {
  return DateMessage(
    after: after ?? this.after,
    any: any ?? this.any,
    array: array ?? this.array,
    before: before ?? this.before,
    betweenDates: betweenDates ?? this.betweenDates,
    every: every ?? this.every,
    refine: refine ?? this.refine,
    required: required ?? this.required,
    weekday: weekday ?? this.weekday,
    weekend: weekend ?? this.weekend,
  );
}