isScheduledFor method

bool isScheduledFor(
  1. DateTime now
)

Whether this announcement is currently within its schedule.

Implementation

bool isScheduledFor(DateTime now) {
  final start = startsAt;
  if (start != null && now.isBefore(start)) return false;
  final end = endsAt;
  if (end != null && now.isAfter(end)) return false;
  return true;
}