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