isYesterday method

bool isYesterday()

Check if DateTime is yesterday

Implementation

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