AppTheme class UI Root
Theme Provider with support switching dark/light.
Read/save from/to SharedPreferences, had default preinitialized value.
Depend on locator
- Inheritance
-
- Object
- BuildlessNotifier<
ThemeMode> - _$AppTheme
- AppTheme
- Annotations
-
- @Riverpod(keepAlive: true)
Constructors
- AppTheme()
Properties
- hashCode → int
-
The hash code for this object.
read-onlyinherited
-
ref
→ NotifierProviderRef<
ThemeMode> -
The Ref from the provider associated with this Notifier.
read-onlyinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
read-onlyinherited
- state ↔ ThemeMode
-
The value currently exposed by this Notifier.
read / writeinherited-getter
- stateOrNull → ThemeMode?
-
The value currently exposed by this Notifier.
read-onlyinherited
Methods
-
build(
) → ThemeMode -
Initialize a Notifier.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
updateShouldNotify(
ThemeMode previous, ThemeMode next) → bool -
A method invoked when the state exposed by this Notifier changes.
It compares the previous and new value, and return whether listeners
should be notified.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- darkTextTheme ↔ TextTheme
-
read / write
- lightTextTheme ↔ TextTheme
-
read / write