PrefServiceShared class

Inheritance

Properties

hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
prefix String
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sharedPreferences → SharedPreferences
final

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() FutureOr<bool>
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.
override
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 nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
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
inherited
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

Static Methods

init({String prefix = '', Map<String, dynamic>? defaults}) Future<PrefServiceShared>