isYesterday static method

bool isYesterday(
  1. DateTime date
)

Checks if date is yesterday.

Implementation

static bool isYesterday(DateTime date) {
  final yesterday = DateTime.now().subtract(const Duration(days: 1));
  return date.year == yesterday.year &&
      date.month == yesterday.month &&
      date.day == yesterday.day;
}