获取保存整型
Future<int?> getInt(String key) async { // obtain shared preferences final prefs = await SharedPreferences.getInstance(); var value = prefs.getInt(key); return Future.value(value); }