lastDayOfMonth property
DateTime
get
lastDayOfMonth
Returns a DateTime representing the last day of the month for this DateTime.
Implementation
DateTime get lastDayOfMonth {
final beginningNextMonth =
(month < 12) ? DateTime(year, month + 1) : DateTime(year + 1);
return beginningNextMonth.subtract(const Duration(days: 1));
}