getDoubleF static method

Future<double> getDoubleF(
  1. String? key, [
  2. double? defValue
])

Returns a Future. Returns 0 if key is null.

Implementation

static Future<double> getDoubleF(String? key, [double? defValue]) async {
  double value;
  if (key == null) {
    return 0;
  }
  if (_prefsInstance == null) {
    final prefs = await instance;
    value = prefs.getDouble(key) ?? defValue ?? 0.0;
  } else {
    // SharedPreferences is available. Ignore init() function.
    _initCalled = true;
    value = getDouble(key, defValue);
  }
  return value;
}