🐛 Fix conditional app wrapper. close #246

This commit is contained in:
2026-02-05 02:42:19 +08:00
parent 863a84a2a0
commit bc02eb6923

View File

@@ -282,11 +282,25 @@ class AppWrapper extends HookConsumerWidget {
return; return;
} }
// Handle bottom navigation routes properly to prevent navigation bar disappearance
// These routes should navigate within the bottom navigation shell
final bottomNavRoutes = ['/', '/explore', '/chat', '/realms', '/account'];
if (bottomNavRoutes.contains(path)) {
// Navigate within the bottom navigation shell using go() to maintain shell context
router.go(path);
if (!kIsWeb &&
(Platform.isWindows || Platform.isLinux || Platform.isMacOS)) {
windowManager.show();
}
return;
}
if (uri.queryParameters.isNotEmpty) { if (uri.queryParameters.isNotEmpty) {
path = Uri.parse( path = Uri.parse(
path, path,
).replace(queryParameters: uri.queryParameters).toString(); ).replace(queryParameters: uri.queryParameters).toString();
} }
// For non-bottom navigation routes, use push() to navigate outside the shell
router.push(path); router.push(path);
if (!kIsWeb && if (!kIsWeb &&
(Platform.isWindows || Platform.isLinux || Platform.isMacOS)) { (Platform.isWindows || Platform.isLinux || Platform.isMacOS)) {