setInt static method

Future<void> setInt(
  1. String key,
  2. int value
)

存储整型值到 SharedPreferences

示例:

await SharepUtil.setInt('age', 25);

Implementation

static Future<void> setInt(String key, int value) async {
  final prefs = _prefs ?? await init();
  await prefs.setInt(key, value);
}