ThemeServiceMem class

A service that stores and retrieves theme settings from memory only.

This class does not persist user settings, it only returns start default values. The runtime in memory storage is actually handled by the theme controller.

To actually persist the settings locally, use the ThemeServicePrefs implementation that uses the shared_preferences package to persists the values, or the ThemeServiceHive that uses the hive package to accomplish the same thing. You could also make an implementation that stores settings on a web server, e.g. with the http package.

The ThemeController that this is service is used with, keeps all latest setting values in memory itself, so this memory implementation does not really do anything when calling save for each property, they are all just no-op.

Loading values from it just returns the default value for each settings property.

Implemented types

Constructors

ThemeServiceMem()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

init() Future<void>
ThemeServiceMem implementations needs no init, it is just a no op.
override
load<T>(String key, T defaultValue) Future<T>
Loads a setting from the Theme service, using a key to access it. Just returning default value for the in memory service that does not persist values.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
save<T>(String key, T value) Future<void>
Save a setting to the Theme service, using key, as key for the value. The in memory version does nothing just a no op.
override
toString() String
A string representation of this object.
inherited

Operators

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