isCurrentYear property

bool get isCurrentYear

Checks if the number (assumed to represent a year) corresponds to the current year.

Example:

2024.isCurrentYear; // Returns true if the current year is 2024

Implementation

bool get isCurrentYear {
  final now = DateTime.now();
  return toInt() == now.year;
}