isYesterday static method

bool isYesterday(
  1. DateTime date
)

Check if date is yesterday

date - The date to check Returns true 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;
}