PrfInt constructor

PrfInt(
  1. String key, {
  2. int? defaultValue,
})

Creates a new integer preference variable with the specified key.

The optional defaultValue is returned if the preference is not found or if an error occurs while reading.

Implementation

PrfInt(String key, {int? defaultValue})
    : super(
        key,
        (prefs, key) async => await prefs.getInt(key),
        (prefs, key, value) async => await prefs.setInt(key, value),
        defaultValue,
      );