feat: 统一首页与推荐搜索入口
This commit is contained in:
1 parent
933333b0fe
commit
9aa797504b
18 files changed
+325
-107
No files matched your search
@@ -17,7 +17,6 @@ class HomeLogic extends ChangeNotifier {
|
||||
final scaffoldKey = GlobalKey<ScaffoldState>();
|
||||
Drama currentDrama;
|
||||
int tab = 0;
|
||||
int searchRequest = 0;
|
||||
int resumeRequest = 0;
|
||||
int backRequest = 0;
|
||||
int followingHistoryRequest = 0;
|
||||
@@ -31,10 +30,9 @@ class HomeLogic extends ChangeNotifier {
|
||||
if (!_disposed) notifyListeners();
|
||||
}
|
||||
|
||||
void select(int nextTab, {bool search = false, bool resume = false}) {
|
||||
void select(int nextTab, {bool resume = false}) {
|
||||
FocusManager.instance.primaryFocus?.unfocus();
|
||||
tab = nextTab;
|
||||
if (search) searchRequest++;
|
||||
if (resume) resumeRequest++;
|
||||
notify();
|
||||
}
|
||||
@@ -81,7 +79,7 @@ class HomeLogic extends ChangeNotifier {
|
||||
case DiscoverPageAction.home:
|
||||
select(0);
|
||||
case DiscoverPageAction.recommend:
|
||||
select(1, search: true);
|
||||
select(1);
|
||||
case DiscoverPageAction.following:
|
||||
select(2);
|
||||
case DiscoverPageAction.mine:
|
||||
@@ -112,7 +110,7 @@ class HomeLogic extends ChangeNotifier {
|
||||
case MyPageAction.home:
|
||||
select(0);
|
||||
case MyPageAction.recommend:
|
||||
select(1, search: true);
|
||||
select(1);
|
||||
case MyPageAction.following:
|
||||
select(2);
|
||||
case MyPageAction.mine:
|
||||
|
||||
@@ -22,7 +22,7 @@ import '../../core/widgets/app_root_tab.dart';
|
||||
import '../../core/widgets/catalog_endpoint_editor.dart';
|
||||
import '../../core/widgets/empty_state.dart';
|
||||
import '../../l10n/app_localizations.dart';
|
||||
import '../discover/discover_view.dart';
|
||||
import '../discover/search_page.dart';
|
||||
import '../following/following_page.dart';
|
||||
import '../filter/filter_page.dart';
|
||||
import '../mine/mine_types.dart';
|
||||
@@ -292,9 +292,9 @@ class _HomeTabsState extends State<_HomeTabs> {
|
||||
}
|
||||
|
||||
void _openSearch(BuildContext context) {
|
||||
Navigator.of(context).push<void>(
|
||||
MaterialPageRoute(builder: (_) => const DiscoverPage(focusSearch: true)),
|
||||
);
|
||||
Navigator.of(
|
||||
context,
|
||||
).push<void>(MaterialPageRoute(builder: (_) => const SearchPage()));
|
||||
}
|
||||
|
||||
void _pushPage(BuildContext context, Widget page) {
|
||||
|
||||
Reference in new issue
Block a user