ThemeManager class abstract
A customizable theme manager that provides responsive theme switching between light, dark, and system modes with change notification support.
Extend this class to define your application's specific light and dark themes, then use the provided methods to manage theme changes throughout your app.
- Inheritance
-
- Object
- ChangeNotifier
- ThemeManager
Constructors
Properties
- darkTheme → ThemeData
-
The dark theme configuration for your application
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- isDarkMode → bool
-
Checks if dark mode is currently active
no setter
- lightTheme → ThemeData
-
The light theme configuration for your application
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- themeData → ThemeData
-
Returns the current theme data based on active theme mode
no setter
- themeMode → ThemeMode
-
Returns the current active theme mode
no setter
Methods
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
cycleThemeModes(
) → void - Cycles through all available theme modes: Light → Dark → System
-
dispose(
) → void -
Discards any resources used by the object. After this is called, the
object is not in a usable state and should be discarded (calls to
addListener will throw after the object is disposed).
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
onThemeUpdated(
) → void - Called whenever the theme changes - override to perform custom actions
-
refreshTheme(
) → void - Forces a theme refresh, useful when system brightness changes
-
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
setThemeMode(
ThemeMode mode) → void - Changes the current theme mode
-
toggleTheme(
) → void - Toggles between light and dark modes only
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited