nextDay method
Returns the next day.
This method calculates the day after the current DateTime object.
It handles month and year changes correctly.
isStartOfDay if true, returns the next day at 00:00:00.
Audited: 2026-06-12 11:26 EDT
Implementation
@useResult
DateTime nextDay({bool isStartOfDay = true}) {
DateTime result = add(_oneDay);
if (isStartOfDay) {
result = DateTime(result.year, result.month, result.day);
}
return result;
}