getInt method

Future<int?> getInt(
  1. String key
)

获取保存整型

Implementation

Future<int?> getInt(String key) async {
  // obtain shared preferences
  final prefs = await SharedPreferences.getInstance();
  var value = prefs.getInt(key);
  return Future.value(value);
}