getDouble abstract method

double getDouble(
  1. String key,
  2. double defaultValue
)

Gets a 64-bit floating-point value. Returns defaultValue if the key is missing or the stored type is not double. key Lookup key. defaultValue Value to return when not found or type mismatch. Returns Stored double or defaultValue.

Example:

// Retrieve double values with defaults
double userLat = _userStorage!.getDouble("user_location_lat", 0.0);
double userLng = _userStorage!.getDouble("user_location_lng", 0.0);
double nonExistentDouble = _userStorage!.getDouble(
 "non_existent_double",
 -1.0,
);
print("User location lat: $userLat");
print("User location lng: $userLng");
print("Non-existent double: $nonExistentDouble");

Implementation

double getDouble(String key, double defaultValue);