Сравнение двух дат по году
bool isSameYearDate(DateTime? date) { if (date == null) return false; return year == date.year; }