nextDay method

  1. @useResult
DateTime nextDay({
  1. bool isStartOfDay = true,
})

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.

Implementation

@useResult
DateTime nextDay({bool isStartOfDay = true}) {
  DateTime result = add(_oneDay);
  if (isStartOfDay) {
    result = DateTime(result.year, result.month, result.day);
  }

  return result;
}