putBool method

  1. @override
void putBool(
  1. String key,
  2. bool value
)
override

Stores a boolean value under the key, replacing any existing value. key Key to set. value Value to store.

Example:

// Store boolean values
_userStorage!.putBool("is_premium", true);
_userStorage!.putBool("notifications_enabled", false);
print("Stored boolean values");

Implementation

@override
void putBool(String key, bool value) {
    final _putBoolFfi = __lib.catchArgumentError(() => __lib.nativeLibrary.lookupFunction<
        Void Function(Pointer<Void>, NativeString, Uint8),
        void Function(Pointer<Void>, NativeString, int)
      >('navigine_sdk_flutter_KeyValueStorage_putBool__Key_Value'));
    _putBoolFfi(this.ptr, toNativeString(key), (value ? 1 : 0));
    exception.checkCallResult();
}