getIntAsync function

int getIntAsync(
  1. String key, {
  2. int defaultValue = 0,
})

Returns a Int if exists in SharedPref

Implementation

int getIntAsync(String key, {int defaultValue = 0}) {
  return sharedPreferences.getInt(key) ?? defaultValue;
}