getInt function

  1. @Deprecated('Use getIntAsync instead without using await')
Future<int> getInt(
  1. String key, {
  2. dynamic defaultValue = 0,
})

Returns a Int if exists in SharedPref

Implementation

@Deprecated('Use getIntAsync instead without using await')
Future<int> getInt(String key, {defaultValue = 0}) async {
  return await getSharedPref().then((pref) {
    return pref.getInt(key) ?? defaultValue;
  });
}