getInt method

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

Returns the stored int, or defaultValue if not found.

Implementation

int? getInt(String key, {int? defaultValue}) {
  try {
    return _store.getInt(key) ?? defaultValue;
  } catch (e, st) {
    throw StorageException(
      message: 'Failed to get int',
      key: key,
      cause: e,
      stackTrace: st,
    );
  }
}