PrefServiceCache class Null safety

Memory preference storage

Inheritance

Constructors

PrefServiceCache({Map<String, dynamic>? cache, Map<String, dynamic>? defaults})
Create a memory preference storage

Properties

hashCode int
The hash code for this object.
read-onlyinherited
hasListeners bool
Whether any listeners are currently registered.
@protectedread-onlyinherited
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited

Methods

addKeyListener(String key, VoidCallback f) → void
Add a ChangeNotifier to this key
inherited
addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
apply(BasePrefService other) Future<void>
Merge the preference values from other
inherited
clear() → void
Clear all values
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
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
fromMap(Map<String, dynamic> map) Future<void>
Import the preference values from a Map
inherited
get<T>(String key) → T?
Get a preference value
override
getKeys() Set<String>
Get all preference keys
override
getStringList(String key) List<String>?
Get a set of string values
override
isSecret(String key) bool
Is this preference a secret value?
inherited
makeAllSecret(Iterable<String> keys) → void
Mark all preferences as secret/confidential.
inherited
makeSecret(String key) → void
Register this preference as secret/confidential and do not log the value displays
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
put<T>(String key, T val) FutureOr<bool>
Set a preference value, always trigger a change
override
remove(String key) FutureOr<bool>
Remove the value for a preference
override
removeKeyListener(String key, VoidCallback f) → void
Remove a ChangeNotifier to this key
inherited
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
set<T>(String key, T val) FutureOr<bool>
Set a preference value if it has changed
@nonVirtualinherited
setDefaultValues(Map<String, dynamic> values) Future<bool>
Set the default preference values
inherited
stream<T>(String key) Stream<T>
Get a stream on the preference changes
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toMap() Map<String, dynamic>
Export the preference values to a Map
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A brief description of this object, usually just the runtimeType and the hashCode.
inherited

Operators

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