add search button for mobile platform

This commit is contained in:
wgh19
2024-06-18 19:56:52 +08:00
parent eee1141970
commit 0143a67fa0

View File

@@ -311,7 +311,26 @@ class _MainPageState extends State<MainPage>
], ],
), ),
).paddingTop(4).paddingLeft(4), ).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<MainPage>
PopInvokedCallback? get onPopInvoked => onPop; PopInvokedCallback? get onPopInvoked => onPop;
void onPop(bool value) { void onPop(bool value) {
print("ok");
if (App.rootNavigatorKey.currentState?.canPop() ?? false) { if (App.rootNavigatorKey.currentState?.canPop() ?? false) {
App.rootNavigatorKey.currentState?.pop(); App.rootNavigatorKey.currentState?.pop();
} else if (App.mainNavigatorKey?.currentState?.canPop() ?? false) { } else if (App.mainNavigatorKey?.currentState?.canPop() ?? false) {