isYesterday static method

bool isYesterday(
  1. DateTime? dateTime
)

Implementation

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