PersistentStringSet class
Properties
-
hashCode
→ int
-
The hash code for this object.
no setterinherited
-
length
→ int
-
no setterinherited
-
runtimeType
→ Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
add(String value)
→ Future<bool>
-
Add
value
to the set. Returns true if the value was not already present.
If the set was modified, it is persisted immediately.
inherited
-
addAll(Iterable<String> values)
→ Future<void>
-
Add all
values
to the set. If the set was modified, it is persisted
immediately.
If values
is empty or all values are already present, no write occurs.
This method is more efficient than calling add repeatedly.
inherited
-
clear()
→ Future<void>
-
Remove all elements from the set and removes the key from SharedPreferences.
inherited
-
contains(String? element)
→ bool
-
inherited
-
lookup(String? element)
→ String?
-
Set.lookup preserves the actual stored instance (useful if T overrides ==).
inherited
-
noSuchMethod(Invocation invocation)
→ dynamic
-
Invoked when a nonexistent method or property is accessed.
inherited
-
remove(String? value)
→ Future<bool>
-
Remove
value
from the set. Returns true if the value was present.
If the set was modified, it is persisted immediately.
If value
is null, does nothing and returns false.
inherited
-
removeWhere(bool test(String))
→ Future<void>
-
Remove all elements that match the given
test
.
If the set was modified, it is persisted immediately.
If no elements match, no write occurs.
inherited
-
toSet({bool reload = false})
→ Set<String>
-
Access a copy of the set.
reload
forces a reload from SharedPreferences.
This is rarely needed, as the each instance is expected to be the sole
modifier of its key. If multiple instances modify the same key,
use reload
to get the latest value.
inherited
-
toString()
→ String
-
A string representation of this object.
inherited
Static Methods
-
create(String key, {Set<String>? seedIfEmpty})
→ Future<PersistentStringSet>
-
Create or load a persistent set of strings at
key
.
If the key does not exist and seedIfEmpty
is provided, it will be used to
initialize the set and persist it immediately.
override