encodeBool method

bool encodeBool(
  1. String key,
  2. bool value, [
  3. int? expireDurationInSecond
])

expireDurationInSecond override the default duration setting from enableAutoKeyExpire().

Implementation

bool encodeBool(String key, bool value, [int? expireDurationInSecond]) {
  final keyPtr = key.toNativeUtf8();
  final ret = (expireDurationInSecond == null)
      ? _encodeBool(_handle, keyPtr, _bool2Int(value))
      : _encodeBoolV2(_handle, keyPtr, _bool2Int(value), expireDurationInSecond);
  calloc.free(keyPtr);
  return _int2Bool(ret);
}