ArcaneThemeService class
A singleton service that manages theme switching and customization for the application.
ArcaneThemeService allows switching between light and dark themes and provides
methods to customize the themes. The current theme mode can be accessed, and the
theme can be switched at runtime.
System theme changes are detected by the ArcaneApp widget, which ensures
theme updates happen automatically when the device theme changes.
- Inheritance
-
- Object
- ArcaneService
- ArcaneThemeService
Properties
- currentTheme → ThemeData
-
The currently active theme style as a snapshot value.
no setter
- currentThemeMode → ThemeMode
-
The currently active theme mode (light, dark, or system) as a snapshot value.
no setter
- dark ↔ ThemeData
-
Returns the current dark theme
ThemeDataas a snapshot value.getter/setter pair -
darkTheme
→ ValueNotifier<
ThemeData> -
ValueNotifier for the dark theme that can be observed for changes.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- isFollowingSystemTheme → bool
-
Whether the theme service is currently following the system theme.
no setter
- light ↔ ThemeData
-
Returns the current light theme
ThemeDataas a snapshot value.getter/setter pair -
lightTheme
→ ValueNotifier<
ThemeData> -
ValueNotifier for the light theme that can be observed for changes.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- systemThemeMode → ThemeMode
-
Returns the
ThemeModecorresponding to the current system themeno setter -
themeDataChanges
→ Stream<
ThemeData> -
Stream of
ThemeDatachanges that can be listened to for reactive UI updates.no setter -
themeModeChanges
→ Stream<
ThemeMode> -
Stream of
ThemeModechanges that can be listened to for reactive UI updates.no setter
Methods
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
currentModeOf(
BuildContext context) → ThemeMode -
Returns the current
ThemeModebeing used byArcaneThemeService. Will automatically update when the theme changes. -
dispose(
) → void -
Discards any resources used by the object.
override
-
followSystemTheme(
BuildContext context) → ArcaneThemeService - Switches the current theme between light and dark modes automatically based upon the system's current mode.
-
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
-
reset(
) → void - Resets the theme service to its default state.
-
setDarkTheme(
ThemeData theme) → ArcaneThemeService -
Sets a custom
ThemeDatafor the dark theme. -
setInitialTheme(
BuildContext context) → void - Syncs the initial theme with the platform/effective mode snapshot.
-
setLightTheme(
ThemeData theme) → ArcaneThemeService -
Sets a custom
ThemeDatafor the light theme. -
switchTheme(
{ThemeMode? themeMode}) → ArcaneThemeService - Switches the current theme between light and dark modes.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- I → ArcaneThemeService
-
no setter