import 'base_notifier.dart'; enum LibraryRefreshType { collections, playlists } /// Notifier for triggering refreshes of library tabs. /// /// Singleton pattern with reinitializable state. The controller is lazily /// created and automatically recreated if disposed and later accessed. class LibraryRefreshNotifier extends BaseNotifier { static final LibraryRefreshNotifier _instance = LibraryRefreshNotifier._internal(); factory LibraryRefreshNotifier() => _instance; LibraryRefreshNotifier._internal(); /// Stream for collections tab (backward compatible) Stream get collectionsStream => stream.where((t) => t == LibraryRefreshType.collections).cast(); /// Stream for playlists tab (backward compatible) Stream get playlistsStream => stream.where((t) => t == LibraryRefreshType.playlists).cast(); void notifyCollectionsChanged() { notify(LibraryRefreshType.collections); } void notifyPlaylistsChanged() { notify(LibraryRefreshType.playlists); } }