feat(flutter): 重构四 Tab 与浏览页

This commit is contained in:
Zhou Weidong committed 2026-10-20 09:49:42 +08:00
1 parent 99c72e2c32
commit 959edc0a32
41 files changed
+2148 -1179

No files matched your search

+16
View File
@@ -28,6 +28,8 @@ class DiscoverLogic extends ChangeNotifier {
String _lastRequestedQuery = '';
int _searchRequest = 0;
bool _disposed = false;
TheaterLanguage language = TheaterLanguage.all;
String? selectedCategoryId;
bool get hasSearchQuery => search.text.trim().isNotEmpty;
@@ -48,6 +50,20 @@ class DiscoverLogic extends ChangeNotifier {
void openSearch() => searchFocus.requestFocus();
/// Selects a language for the visual filter state.
void selectLanguage(TheaterLanguage value) {
if (language == value) return;
language = value;
notify();
}
/// Selects one category chip; null represents all categories.
void selectCategory(String? categoryId) {
if (selectedCategoryId == categoryId) return;
selectedCategoryId = categoryId;
notify();
}
void retrySearch() {
final query = search.text.trim();
if (query.isNotEmpty) unawaited(_runSearch(query));