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].