isTomorrow method

  1. @useResult
bool isTomorrow({
  1. DateTime? now,
})

Returns true if this DateTime is the calendar day after now.

Compares date-only (year/month/day), so the time component is irrelevant: 23:59 on the next day still counts as tomorrow. Pass now to pin the clock for deterministic tests.

Not DST-safe across a transition: now.add(Duration(days: 1)) advances a fixed 24h, so on a "spring forward" (23h) or "fall back" (25h) local day the resulting wall-clock date can land on the wrong calendar day.

Example:

final now = DateTime(2024, 6, 15);
DateTime(2024, 6, 16).isTomorrow(now: now); // true
DateTime(2024, 6, 15).isTomorrow(now: now); // false

Audited: 2026-06-12 11:26 EDT

Implementation

@useResult
bool isTomorrow({DateTime? now}) {
  final DateTime tomorrow = (now ?? DateTime.now()).add(const Duration(days: 1));

  return isSameDateOnly(tomorrow);
}