pref<T> method
- PrefKey<
T> key
Watches key and returns its effective value, typed via the key.
Returns the key's default while preferences are loading or unavailable.
Implementation
T pref<T>(PrefKey<T> key) =>
watch(preferenceValueProvider(key)) as T? ?? key.defaultValue;