getInt method

Future<int> getInt(
  1. String key, {
  2. int defValue = 0,
})

Implementation

Future<int> getInt(String key, {int defValue = 0}) async{
  SharedPreferences pref = _pref!;
  int value = pref.getInt(key) ?? defValue;
  return value;
}