AdaptiveThemeManager<T extends Object> mixin

Entry point to change/modify theme or access theme related information from AdaptiveTheme. An instance of this can be retrieved by calling AdaptiveTheme.of.

Properties

brightness Brightness?
provides brightness of the current theme
no setter
darkTheme → T
provides the dark theme
no setter
debugShowFloatingThemeButton bool
Whether to show floating theme mode switcher button or not.
no setter
defaultMode AdaptiveThemeMode
Returns the default(initial) theme mode
no setter
hashCode int
The hash code for this object.
no setterinherited
isDefault bool
checks whether current theme is default theme or not. Default theme refers to he themes provided at the time of initialization of MaterialApp.
no setter
lightTheme → T
provides the light theme
no setter
mode AdaptiveThemeMode
Returns current theme mode
no setter
modeChangeNotifier ValueNotifier<AdaptiveThemeMode>
Allows to listen to changes in them mode.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
theme → T
provides current theme
no setter

Methods

initialize({required T light, required T dark, required AdaptiveThemeMode initial}) → void
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
persist() Future<bool>
Saves the configuration to the shared-preferences. This can be useful when you want to persist theme settings after clearing shared-preferences. e.g. when user logs out, usually, preferences are cleared. Call this method after clearing preferences to persist theme mode.
reset() Future<bool>
Resets configuration to default configuration which has been provided while initializing MaterialApp. If setTheme method has been called with isDefault to true, Calling this method afterwards will use theme provided by setTheme as default themes. Implementations of this method should end with a call to the inherited method, as in super.reset().
setDark() → void
Sets dark theme as current Uses AdaptiveThemeMode.dark.
setDebugShowFloatingThemeButton(bool enabled) → void
Sets whether to show floating theme mode switcher button or not.
setLight() → void
Sets light theme as current Uses AdaptiveThemeMode.light.
setSystem() → void
Sets theme based on the theme of the underlying OS. Uses AdaptiveThemeMode.system.
setTheme({required T light, T? dark, bool notify = true}) → void
Allows to set/change the entire theme. notify when set to true, will update the UI to use the new theme..
setThemeMode(AdaptiveThemeMode mode) → void
Allows to set/change theme mode.
toggleThemeMode({bool useSystem = true}) → void
Allows to toggle between theme modes AdaptiveThemeMode.light, AdaptiveThemeMode.dark and AdaptiveThemeMode.system.
toString() String
A string representation of this object.
inherited
updateState() → void

Operators

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