isWithinNextHours method

bool isWithinNextHours(
  1. int hours
)

Checks if the current time is within the next N hours

Implementation

bool isWithinNextHours(int hours) {
  final now = DateTime.now();
  final futureTime = now.add(Duration(hours: hours));
  return isAfter(now) && isBefore(futureTime);
}