getInt static method
获取int类型数据,如果没有则返回默认值
key 键
defValue 默认值:默认为0
Implementation
static Future<int> getInt(String key, [int defValue = 0]) async {
SharedPreferences prefs = await SharedPreferences.getInstance();
int? value = prefs.getInt(key) ?? defValue;
_println('getInt', key, value);
return value;
}