getBool method
Starts with the current bool value for the given key
, then emits a new
value every time there are changes to the value associated with key
.
If the value is null, starts with the value provided in defaultValue
. When
the value transitions from non-null to null (ie. when the value is removed),
emits defaultValue
.
Implementation
Preference<bool> getBool(String key, {required bool defaultValue}) {
return getCustomValue(
key,
defaultValue: defaultValue,
adapter: BoolAdapter.instance,
);
}