From 7391e83569c90de57cdf9b49aa7c5bde4b35a8ed Mon Sep 17 00:00:00 2001 From: Brandon Trautmann Date: Wed, 22 May 2024 06:22:57 -0400 Subject: [PATCH] fix: boolSetting returns incorrect value when persisted value does not equal default value --- lib/src/beacon_settings.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/beacon_settings.dart b/lib/src/beacon_settings.dart index 0ff9a31..37dadf8 100644 --- a/lib/src/beacon_settings.dart +++ b/lib/src/beacon_settings.dart @@ -274,7 +274,7 @@ Encoder intEncoder() { /// Decoder for a [Setting] that manages a [bool]. If the value is not in /// the underlying [Storage], [defaultValue] is returned. Decoder boolDecoder({bool defaultValue = false}) { - return (value) => (value is BoolSettingValue && value.value) || defaultValue; + return (value) => value is BoolSettingValue ? value.value : defaultValue; } /// Encoder for a [Setting] that manages a [bool].