doubleSetting method

Setting<double> doubleSetting({
  1. required String key,
  2. double defaultValue = 0.0,
})

Creates a new Setting that manages a double.

A single setting that exposes a type T to the consuming application.

The _key is a function that returns the key for the setting. The _decode function is used to convert the raw value from the underlying storage to the type T. The _encode function is used to convert the value of type T to a raw value that can be stored in the underlying storage.

Implementation

Setting<double> doubleSetting({
  required String key,
  double defaultValue = 0.0,
}) {
  return setting<double>(
    key: key,
    decode: doubleDecoder(defaultValue: defaultValue),
    encode: doubleEncoder(),
  );
}