update method

Date update({
  1. int? year,
  2. int? month,
  3. int? day,
})

Updates the individual year, month or day to a new value.

If the result is not a valid calendar date, either by directly setting an invalid value, like a month of 14, or by chaning the year and month so that the day is now greater than the length of the month, the date is normalized the same way as the Date constructor.

Implementation

Date update({int? year, int? month, int? day}) => Date(year ?? this.year, month ?? this.month, day ?? this.day);