getInt static method

Future<int> getInt(
  1. String key
)

Implementation

static Future<int> getInt(String key) async {
  SharedPreferences prefs = await SharedPreferences.getInstance();
  var result = prefs.getInt(key) ?? 0;
  return result;
  // var box = Hive.box('myBox');
  // var name = box.get( key);
  // return name;
}