load method

Future<void> load()

Implementation

Future<void> load() async {
  final storage = await DefaultKeyValueStorage.getInstance();
  _sortMode = switch (storage.getString(_catalogQueueSortModeStorageKey)) {
    'namespace' => CatalogQueueSortMode.namespace,
    _ => CatalogQueueSortMode.alphabetical,
  };
  _collapsedSections = storage
          .getStringList(_catalogCollapsedSectionsStorageKey)
          ?.map(_queueSectionFromStorage)
          .whereType<CatalogQueueSection>()
          .toSet() ??
      <CatalogQueueSection>{};
  final storedLocale = storage.getString(_catalogLastSelectedLocaleStorageKey);
  _lastSelectedLocale = storedLocale == null || storedLocale.trim().isEmpty ? null : storedLocale.trim();
  _loaded = true;
  notifyListeners();
}