isYesterday property
bool
get
isYesterday
Return true
if given date is same as Yesterday's date.
final checkDate = DateTime.now(); // 16-09-2023
checkDate.prevDay.isYesterday; // true
checkDate.isYesterday ; // false
This will not consider time parameters.
Implementation
bool get isYesterday {
final prevDay = yesterday;
return year == prevDay.year && month == prevDay.month && day == prevDay.day;
}