putLong method

  1. @override
void putLong(
  1. String key,
  2. int value
)
override

Stores a 64-bit integer value under the key, replacing any existing value. key Key to set. value Value to store.

Example:

// Store long values
_userStorage!.putLong("registration_timestamp", 1640995200000);
_userStorage!.putLong(
 "last_login_timestamp",
 DateTime.now().millisecondsSinceEpoch,
);
print("Stored long values");

Implementation

@override
void putLong(String key, int value) {
    final _putLongFfi = __lib.catchArgumentError(() => __lib.nativeLibrary.lookupFunction<
        Void Function(Pointer<Void>, Pointer<Void>, Int64),
        void Function(Pointer<Void>, Pointer<Void>, int)
      >('navigine_sdk_flutter_KeyValueStorage_putLong__Key_Value'));
    final _keyHandle = navigine_sdk_flutter_String_ToFfi(key);
    final _valueHandle = navigine_sdk_flutter_int_ToFfi(value);
    final _handle = this.handle;
    _putLongFfi(_handle, _keyHandle, _valueHandle);
    navigine_sdk_flutter_String_ReleaseFfiHandle(_keyHandle);
    navigine_sdk_flutter_int_ReleaseFfiHandle(_valueHandle);
}