type property

DayType type

Define which sun events happens in the snapshot date

Implementation

DayType get type {
  if (sunrise == null) {
    if (sunset == null) {
      final season = (location.isNorth) ? date.seasonNorth : date.seasonSouth;
      if (season == Season.winter || season == Season.autumn) {
        return DayType.allNight;
      }
      return DayType.allDay;
    }
    return DayType.sunsetOnly;
  }
  if (sunset == null) {
    return DayType.sunriseOnly;
  }
  return DayType.sunriseAndSunset;
}