getBool method

Future<bool> getBool(
  1. String prefKey
)

Implementation

Future<bool> getBool (String prefKey) async {
  final SharedPreferences prefs = await SharedPreferences.getInstance();
  Pref p = getPref (prefKey);
  if (p == null) {
    return false;
  } else {
    return prefs.getBool(prefKey) ?? p.defVal.toString().toLowerCase() == 'true';
  }
}