KeyValueStorage class abstract
键值存储抽象接口,解耦 MMKV 原生依赖以支持单元测试。
- Implementers
Constructors
Properties
Methods
-
clearAll(
) → void - 清空存储中的全部键值。
-
getBool(
String key, {bool defaultValue = false}) → bool -
读取
key的 bool 值;不存在时返回defaultValue。 -
getDouble(
String key, {double defaultValue = 0.0}) → double -
读取
key的 double 值;不存在时返回defaultValue。 -
getInt(
String key, {int defaultValue = 0}) → int -
读取
key的 int 值;不存在时返回defaultValue。 -
getString(
String key) → String? -
读取
key的字符串值;不存在时返回null。 -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
removeValue(
String key) → void -
删除
key对应的值。 -
removeValues(
List< String> keys) → void -
批量删除
keys对应的值。 -
setBool(
String key, bool? value) → bool -
将
value存入key;成功返回true。 -
setDouble(
String key, double? value) → bool -
将
value存入key;成功返回true。 -
setInt(
String key, int? value) → bool -
将
value存入key;成功返回true。 -
setString(
String key, String? value) → bool -
将
value存入key;成功返回true。 -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited