add bar hide type

Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
dom
2026-02-18 21:12:34 +08:00
parent a142b15344
commit 3f3d54fd27
12 changed files with 223 additions and 63 deletions

View File

@@ -31,7 +31,9 @@ class MainController extends GetxController
List<NavigationBarType> navigationBars = <NavigationBarType>[];
RxDouble? barOffset;
RxBool? showBottomBar;
late final bool hideBottomBar;
late final barHideType = Pref.barHideType;
late double navHeight = 80.0;
bool useBottomNav = false;
late dynamic controller;
@@ -86,8 +88,13 @@ class MainController extends GetxController
hideBottomBar =
!useSideBar && navigationBars.length > 1 && Pref.hideBottomBar;
if (hideBottomBar || homeController.hideTopBar) {
barOffset = RxDouble(0.0);
if (hideBottomBar) {
switch (barHideType) {
case .instant:
showBottomBar = RxBool(true);
case .sync:
barOffset ??= RxDouble(0.0);
}
}
dynamicBadgeMode = Pref.dynamicBadgeMode;
@@ -318,6 +325,12 @@ class MainController extends GetxController
}
}
void setSearchBar() {
if (hasHome) {
homeController.showTopBar?.value = true;
}
}
@override
void onClose() {
barOffset?.close();