isSameYear property

bool get isSameYear

Indicates whether the DateTime object belongs to the same year as the current date and time.

Implementation

bool get isSameYear {
  return DateTime.now().year == year;
}