getDateTimeYesterday function

DateTime getDateTimeYesterday([
  1. DateTime? time
])

Returns the start of yesterday from time.

time if null uses DateTime.now .

Implementation

DateTime getDateTimeYesterday([DateTime? time]) {
  time ??= DateTime.now();
  return getDateTimeDayStart(time.subtract(Duration(days: 1)));
}