nextWeek property

DateTime get nextWeek

Returns a DateTime instance representing the exact date of the coming week.

Example:

DateTime currentDate = DateTime(2024, 1, 8);
DateTime nextWeekDate = currentDate.nextWeek;
print(nextWeekDate);  // Output: 2024-01-15 00:00:00

The nextWeek extension calculates and returns a new DateTime instance by adding seven days to the original date, representing the exact date of the coming week.

Implementation

DateTime get nextWeek => add(const Duration(days: 7));