SharedPrefThemeManager class Null safety

A class for retrieving and updating values of dark mode and background colour from shared preferences.

Constructors

SharedPrefThemeManager()

Properties

hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

getBackgroundColour() Future<int>
Retreives the background colour from shared preferences.
getIsDarkMode() Future<bool>
Retrieves the dark mode setting from shared preferences.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
setBackgroundColour(Color backgroundColour) Future<void>
Sets the background colour.
setIsDarkMode(bool isDarkMode) Future<void>
Sets the dark mode state.
toString() String
A string representation of this object. [...]
inherited

Operators

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

Constants

backgroundColourKey → const String
The key used to store background colour.
"backgroundColour"
defaultBackgroundColour → const Color
The default background colour (which is green).
Color.fromRGBO(0, 150, 136, 1)
defaultIsDarkMode → const bool
The default dark mode setting (which is false).
false
isDarkModeKey → const String
The key used to store dark mode state.
"isDarkMode"