isLeapYear method

  1. @override
bool isLeapYear()
override

Checks if a year is a leap year or not.

Implementation

@override
bool isLeapYear() {
  if (year % 4 == 0) {
    if (year % 100 == 0) {
      return year % 400 == 0;
    } else {
      return true;
    }
  } else {
    return false;
  }
}