DayNightTheme constructor
DayNightTheme({})
Implementation
DayNightTheme({
required this.builder,
required this.darkTheme,
required this.lightTheme,
this.sunriseHour = 6,
this.sunriseMinutes = 0,
this.sunsetMinutes = 0,
this.sunsetHour = 19,
}) {
DateTime now = CustomDateTime.current;
DateTime sunriseTime =
DateTime(now.year, now.month, now.day, sunriseHour, sunriseMinutes);
DateTime sunsetTime =
DateTime(now.year, now.month, now.day, sunsetHour, sunsetMinutes);
assert(sunriseTime.isBefore(sunsetTime),
'sunrise time must be less than sunset time');
}