PrfVariableExtensions<T> extension

Extensions on PrfVariable that provide convenient methods for accessing and manipulating persisted values.

These extensions simplify working with stored preferences by handling the SharedPreferences instance internally, allowing for cleaner, more readable code.

on

Methods

existsOnPrefs() Future<bool>

Available on PrfVariable<T>, provided by the PrfVariableExtensions extension

Checks if the key exists in SharedPreferences.
get() Future<T?>

Available on PrfVariable<T>, provided by the PrfVariableExtensions extension

Gets the stored value associated with this variable.
getOrFallback(T fallback) Future<T>

Available on PrfVariable<T>, provided by the PrfVariableExtensions extension

Gets the stored value or returns a fallback if the value is null.
isNull() Future<bool>

Available on PrfVariable<T>, provided by the PrfVariableExtensions extension

Checks if the current value is null in storage.
remove() Future<void>

Available on PrfVariable<T>, provided by the PrfVariableExtensions extension

Removes the value from persistent storage.
set(T value) Future<bool>

Available on PrfVariable<T>, provided by the PrfVariableExtensions extension

Sets the value for this variable in persistent storage.