subtractYears method

DateTime subtractYears(
  1. int years
)

Subtract years from a DateTime

Implementation

DateTime subtractYears(int years) {
  if (this == null) throw Exception("DateTime is null");
  return DateTime(this!.year - years, this!.month, this!.day);
}