isYesterday property
bool
get
isYesterday
Whether this date is yesterday.
Implementation
bool get isYesterday {
final DateTime now = DateTime.now();
final DateTime yesterday = now.subtract(const Duration(days: 1));
return year == yesterday.year &&
month == yesterday.month &&
day == yesterday.day;
}