getAllKeys static method

List<String> getAllKeys()

Returns a list of all keys stored by this utility, without the prefix.

Implementation

static List<String> getAllKeys() {
  final prefix = _keyPrefix;
  final keys = <String>[];

  for (int i = 0; i < window.localStorage.length; i++) {
    final key = window.localStorage.key(i);
    if (key != null && key.startsWith(prefix)) {
      keys.add(key.substring(prefix.length));
    }
  }
  return keys;
}