getInt method

Future<int> getInt(
  1. String prefKey
)

Implementation

Future<int> getInt (String prefKey) async {
  final SharedPreferences prefs = await SharedPreferences.getInstance();
  Pref p = getPref (prefKey);
  if (p == null) {
    return null;
  } else {
    return prefs.getInt(prefKey) ?? int.parse(p.defVal.toString());
  }
}