isNight method

bool isNight()

Check if the date is in the night.

Implementation

bool isNight() {
  if (this == null) return false;
  if (this?.hour == null) return false;
  return this!.hour >= 0 && this!.hour < 6;
}