DayNightThemeChanger constructor
DayNightThemeChanger()
Implementation
DayNightThemeChanger(
this.lightTheme,
this.darkTheme,
this.sunsetHour,
this.sunsetMinutes,
this.sunriseHour,
this.sunriseMinutes,
) {
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');
_init();
}