From 0143a67fa0d083bba88a632a35a2bca85b18a8f9 Mon Sep 17 00:00:00 2001 From: wgh19 Date: Tue, 18 Jun 2024 19:56:52 +0800 Subject: [PATCH] add search button for mobile platform --- lib/pages/main_page.dart | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/lib/pages/main_page.dart b/lib/pages/main_page.dart index c4526cc..0ff709d 100644 --- a/lib/pages/main_page.dart +++ b/lib/pages/main_page.dart @@ -311,7 +311,26 @@ class _MainPageState extends State ], ), ).paddingTop(4).paddingLeft(4), - if (App.isDesktop) const SizedBox(width: 128), + if (App.isDesktop) + const SizedBox(width: 128) + else + Tooltip( + message: "Search".tl, + child: IconButton( + icon: const Icon( + MdIcons.search, + size: 18, + ), + onPressed: () { + if(index == 1) { + return; + } + setState(() { + index = 1; + }); + navigate(1); + }, + )), ], ), ), @@ -339,7 +358,6 @@ class _MainPageState extends State PopInvokedCallback? get onPopInvoked => onPop; void onPop(bool value) { - print("ok"); if (App.rootNavigatorKey.currentState?.canPop() ?? false) { App.rootNavigatorKey.currentState?.pop(); } else if (App.mainNavigatorKey?.currentState?.canPop() ?? false) {