@@ -61,10 +61,10 @@ class DaylightResult {
6161 DaylightResult (this .sunrise, this .sunset, this ._date, this .location);
6262
6363 /// Time of the sunset in UTC
64- final DateTime sunrise;
64+ final DateTime ? sunrise;
6565
6666 /// Time of the sunset in UTC
67- final DateTime sunset;
67+ final DateTime ? sunset;
6868
6969 final DaylightLocation location;
7070
@@ -112,7 +112,7 @@ class DaylightCalculator {
112112 /// Calculate the time of an specific sun event
113113 ///
114114 /// Returns in UTC.
115- DateTime calculateEvent (DateTime date, Zenith zenith, EventType type) {
115+ DateTime ? calculateEvent (DateTime date, Zenith zenith, EventType type) {
116116 final lastMidnight = DateTime (date.year, date.month, date.day);
117117
118118 final eventMils = _calculate (date, zenith, type);
@@ -123,7 +123,7 @@ class DaylightCalculator {
123123 return DateTime .fromMillisecondsSinceEpoch (mils, isUtc: true );
124124 }
125125
126- double _calculate (DateTime time, Zenith zenith, EventType type) {
126+ double ? _calculate (DateTime time, Zenith zenith, EventType type) {
127127 final double baseLongHour = location.long / 15 ;
128128
129129 final double hour = _longToHour (time, type == EventType .sunrise ? 6 : 18 );
0 commit comments