addYears method

  1. @override
DateTime addYears(
  1. DateTime date,
  2. int years
)
override

Returns a new DateTime where the week is the same inside the month and is years years from this week and the DateTime.weekday is equal to weekday.

Implementation

@override
DateTime addYears(DateTime date, int years) => addMonths(date, years * 12);