🐛 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;
}
// 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) {
path = Uri.parse(
path,
).replace(queryParameters: uri.queryParameters).toString();
}
// For non-bottom navigation routes, use push() to navigate outside the shell
router.push(path);
if (!kIsWeb &&
(Platform.isWindows || Platform.isLinux || Platform.isMacOS)) {