PreferencesRepository<T> class
PreferencesRepository that takes SharedPreferences
directly. Be aware that SharedPreferences.getInstance() returns
Future
so you have to wait for that to complete (eg. during your app startup) to be able to use this class!
If you don't want to do this, just use FuturePreferencesRepository
Constructors
-
PreferencesRepository(SharedPreferences prefs, DesSer<
T> desSer)
Properties
Methods
-
findAll(
) → List< T> - Returns all saved objects from the repository
-
findAllWhere(
bool test(T element)) → List< T> -
findFirstWhere(
bool test(T element), {T orElse()?}) → T? -
findOne(
int i) → T? -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
remove(
int index) → List< T> -
removeAll(
) → void -
removeWhere(
bool test(T element)) → void -
save(
T t) → int - Saves new object in repository
-
saveAll(
List< T> list) → void - Saves all objects in repository
-
toString(
) → String -
A string representation of this object.
inherited
-
update(
int index, T t) → void -
updateWhere(
bool test(T t), T t) → void
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited