isYesterday property

bool get isYesterday

Check if the date is yesterday, consider gap of year, month, day

Implementation

bool get isYesterday {
  final nowDate = DateTime.now();
  final yesterdayDate = nowDate.subtract(Duration(days: 1));
  return year == yesterdayDate.year &&
      month == yesterdayDate.month &&
      day == yesterdayDate.day;
}