SolidPreferencesNotifier class

Notifier for managing preferences state across the application. Preferences are automatically persisted to SharedPreferences.

Inheritance

Constructors

SolidPreferencesNotifier([SolidPreferencesConfig? initialConfig])
Creates a new SolidPreferencesNotifier with optional initial configuration.

Properties

appBarActions List<SolidAppBarActionItem>
The current AppBar action items.
no setter
config SolidPreferencesConfig
The current preferences configuration.
no setter
hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
isInitialized bool
Whether the notifier has been initialised from SharedPreferences.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
themeModeConfig SolidThemeModeConfig
The current theme mode configuration.
no setter

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
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
initialize() Future<void>
Initialises the notifier by loading preferences from SharedPreferences.
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
reorderAppBarAction(int oldIndex, int newIndex) → void
Reorders an action item from one position to another.
setActionOverflow(String actionId, bool showInOverflow) → void
Sets whether an action should appear in the overflow menu.
setAppBarActions(List<SolidAppBarActionItem> actions) → void
Updates the AppBar action items. Also updates the default actions for icon lookups during deserialisation.
setConfig(SolidPreferencesConfig config) → void
Updates the entire preferences configuration.
setDarkModeEnabled(bool enabled) → void
Sets whether dark mode is enabled in the toggle cycle.
setDefaultAppBarActions(List<SolidAppBarActionItem> actions) → void
Sets the default AppBar actions. These are used to look up icon definitions when loading from storage.
setLightModeEnabled(bool enabled) → void
Sets whether light mode is enabled in the toggle cycle.
setSmartToggle(bool enabled) → void
Sets whether smart toggle behaviour is enabled.
setSystemModeEnabled(bool enabled) → void
Sets whether system mode is enabled in the toggle cycle.
setThemeModeConfig(SolidThemeModeConfig themeModeConfig) → void
Updates only the theme mode configuration.
toggleActionOverflow(String actionId) → void
Toggles whether an action should appear in the overflow menu.
toString() String
A string representation of this object.
inherited

Operators

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