getDouble method
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
@override
double getDouble(String key, double defaultValue) {
final _getDoubleFfi = __lib.catchArgumentError(() => __lib.nativeLibrary.lookupFunction<
Double Function(Pointer<Void>, Pointer<Void>, Double),
double Function(Pointer<Void>, Pointer<Void>, double)
>('navigine_sdk_flutter_KeyValueStorage_getDouble__Key_DefaultValue'));
final _keyHandle = navigine_sdk_flutter_String_ToFfi(key);
final _defaultValueHandle = navigine_sdk_flutter_double_ToFfi(defaultValue);
final _handle = this.handle;
final __resultHandle = _getDoubleFfi(_handle, _keyHandle, _defaultValueHandle);
navigine_sdk_flutter_String_ReleaseFfiHandle(_keyHandle);
navigine_sdk_flutter_double_ReleaseFfiHandle(_defaultValueHandle);
final _result = navigine_sdk_flutter_double_FromFfi(__resultHandle);
navigine_sdk_flutter_double_ReleaseFfiHandle(__resultHandle);
return _result;
}