encodeInt32 method
Use this when the value
won't be larger than a normal int32.
It's more efficient & cost less space.
expireDurationInSecond
override the default duration setting from enableAutoKeyExpire().
- Passing MMKV.ExpireNever (aka 0) will never expire.
Implementation
bool encodeInt32(String key, int value, [int? expireDurationInSecond]) {
final keyPtr = key.toNativeUtf8();
final ret =
(expireDurationInSecond == null) ? _encodeInt32(_handle, keyPtr, value) : _encodeInt32V2(_handle, keyPtr, value, expireDurationInSecond);
calloc.free(keyPtr);
return _int2Bool(ret);
}