getDouble static method

double getDouble(
  1. String? key, [
  2. double? defValue
])

Returns 0 if key is null.

Implementation

static double getDouble(String? key, [double? defValue]) {
  if (key == null) {
    return 0;
  }
  assert(_initCalled, 'Prefs.init() must be called first!');
  assert(_prefsInstance != null,
      'Maybe call Prefs.getDoubleF(key) instead. SharedPreferences not ready yet!');
  return _prefsInstance?.getDouble(key) ?? defValue ?? 0.0;
}