getDouble method

Future<double?> getDouble(
  1. String key
)

获取保存的浮点型

Implementation

Future<double?> getDouble(String key) async {
  // obtain shared preferences
  final prefs = await SharedPreferences.getInstance();
  var value = prefs.getDouble(key);
  return Future.value(value);
}