DayNightThemeChanger class

Inheritance

Constructors

DayNightThemeChanger(ThemeData lightTheme, ThemeData darkTheme, int sunsetHour, int sunsetMinutes, int sunriseHour, int sunriseMinutes)

Properties

darkTheme → ThemeData
final
hashCode → int
The hash code for this object.
no setterinherited
hasListeners → bool
Whether any listeners are currently registered.
no setterinherited
isLightTheme → bool
returns true if current selected theme is light theme
no setter
lightTheme → ThemeData
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
selectedTheme → ThemeData
Currently selected theme
no setter
sunriseHour → int
Morning hour in 24 hours format default is 6 in the morning
final
sunriseMinutes → int
Morning minutes default in 0
final
sunsetHour → int
Evening start hour in 24 hours format default is 19
final
sunsetMinutes → int
Evening start minutes default in 0
final

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
changeTheme(ThemeData newTheme, {bool turnOffDynamicThemeChange = false}) → dynamic
Manually change the theme of the app If you don't wish to change the theme at sunset / sunrise time set the turnOffDynamicThemeChange to true
dispose() → void
Discards any resources used by the object.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited