getDouble static method
获取双精度浮点数
key 键
defaultValue 未找到时的默认值,默认为 0.0
示例:
double salary = SharepUtil.getDouble('salary', defaultValue: 8888.8);
print(salary); // 例如: 8888.8
返回结果: double 读取到的值
Implementation
static double getDouble(String key, {double defaultValue = 0.0}) {
return _prefs?.getDouble(key) ?? defaultValue;
}