BasePrefService class abstract
Base class for the preferences storage
- Inheritance
-
- Object
- ChangeNotifier
- BasePrefService
- Mixed in types
- Implementers
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addKeyListener(
String key, VoidCallback f) → void - Add a ChangeNotifier to this key
-
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
-
clear(
) → void - Clear all values
-
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).
override
-
fromMap(
Map< String, dynamic> map) → Future<void> - Import the preference values from a Map
-
get<
T> (String key) → T? - Get a preference value
-
getKeys(
) → Set< String> - Get all preference keys
-
getStringList(
String key) → List< String> ? - Get a set of string values
-
isSecret(
String key) → bool - Is this preference a secret value?
-
makeAllSecret(
Iterable< String> keys) → void - Mark all preferences as secret/confidential.
-
makeSecret(
String key) → void - Register this preference as secret/confidential and do not log the value displays
-
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
-
remove(
String key) → FutureOr< bool> - Remove the value for a preference
-
removeKeyListener(
String key, VoidCallback f) → void - Remove a ChangeNotifier to this key
-
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
-
setDefaultValues(
Map< String, dynamic> values) → Future<bool> - Set the default preference values
-
stream<
T> (String key) → Stream< T> - Get a stream on the preference changes
-
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
-
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