saveInt static method

Future<bool> saveInt(
  1. String key,
  2. int? value, [
  3. int defaultValue = 0
])

Implementation

static Future<bool> saveInt(String key, int? value,
    [int defaultValue = 0]) async {
  final prefs = await SharedPreferences.getInstance();
  return prefs.setInt(key, value ?? defaultValue);
}