getBool method

  1. @override
bool getBool(
  1. String key,
  2. bool defaultValue
)
override

Gets a boolean value. Returns defaultValue if the key is missing or the stored type is not bool. @param key Lookup key. @param defaultValue Value to return when not found or type mismatch. @return Stored bool or defaultValue.

Dart code snippet: @snippet storage_manager_example.dart dart_KeyValueStorage_getBool

Implementation

@override
bool getBool(String key, bool defaultValue) {
    final _getBoolFfi = __lib.catchArgumentError(() => __lib.nativeLibrary.lookupFunction<
        Uint8 Function(Pointer<Void>, Pointer<Void>, Uint8),
        int Function(Pointer<Void>, Pointer<Void>, int)
      >('navigine_sdk_flutter_KeyValueStorage_getBool__Key_DefaultValue'));
    final _keyHandle = navigine_sdk_flutter_String_ToFfi(key);
    final _defaultValueHandle = navigine_sdk_flutter_bool_ToFfi(defaultValue);
    final _handle = this.handle;
    final __resultHandle = _getBoolFfi(_handle, _keyHandle, _defaultValueHandle);
    navigine_sdk_flutter_String_ReleaseFfiHandle(_keyHandle);
    navigine_sdk_flutter_bool_ReleaseFfiHandle(_defaultValueHandle);
    final _result = navigine_sdk_flutter_bool_FromFfi(__resultHandle);
    navigine_sdk_flutter_bool_ReleaseFfiHandle(__resultHandle);
    return _result;
}