intDecoder function
Decoder for a Setting that manages an int. If the value is not in
the underlying Storage, defaultValue
is returned.
Implementation
Decoder<int> intDecoder({int defaultValue = 0}) {
return (value) => value is IntSettingValue ? value.value : defaultValue;
}