isYesterday method

bool isYesterday()

Check if DateTime is yesterday

Implementation

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