boolDecoder function

Decoder<bool> boolDecoder({
  1. bool defaultValue = false,
})

Decoder for a Setting that manages a bool. If the value is not in the underlying Storage, defaultValue is returned.

Implementation

Decoder<bool> boolDecoder({bool defaultValue = false}) {
  return (value) => value is BoolSettingValue ? value.value : defaultValue;
}