clear static method

void clear()

Removes all keys associated with this application's prefix.

This iterates backwards to safely remove items while iterating.

Implementation

static void clear() {
  final prefix = _keyPrefix;
  for (var i = window.localStorage.length - 1; i >= 0; i--) {
    final key = window.localStorage.key(i);
    if (key != null && key.startsWith(prefix)) {
      window.localStorage.removeItem(key);
    }
  }
}