isToday property

bool get isToday

Return true if given date is same as Today's date.

final checkDate = DateTime.now(); // 16-09-2023
checkDate.isToday;                // true
checkDate.nextDay.isToday;        // false

This will not consider time parameters.

Implementation

bool get isToday {
  final now = DateTime.now();
  return year == now.year && month == now.month && day == now.day;
}