isCurrentDate function

bool isCurrentDate(
  1. DateTime date
)

Checks if the given date is equal to the current date.

Implementation

bool isCurrentDate(DateTime date) {
  final DateTime now = DateTime.now();
  return date.isAtSameMomentAs(DateTime(now.year, now.month, now.day));
}