isYesterday property

bool isYesterday

Returns true if this occurs a day before today This doesn't account for time.

Implementation

bool get isYesterday {
  final now = DateTime.now();
  final yesterday = DateTime(now.year, now.month, now.day - 1);
  return day == yesterday.day &&
      month == yesterday.month &&
      year == yesterday.year;
}