isDateAfterToday method

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

Returns true if this date is strictly after today (i.e., tomorrow or later).

Pass now to override the current time (useful for testing).

Implementation

@useResult
bool isDateAfterToday({DateTime? now}) {
  final DateTime currentNow = now ?? DateTime.now();

  final DateTime startOfToday = DateTime(
    currentNow.year,
    currentNow.month,
    currentNow.day,
  );
  final DateTime endOfToday = startOfToday.add(_oneDay).subtract(_oneMicrosecond);

  return isAfter(endOfToday);
}