From 1e2d8b8520a3a25c2eb2f49a60986517efc66ea2 Mon Sep 17 00:00:00 2001 From: Simon Ding Date: Mon, 4 Nov 2024 12:03:32 +0800 Subject: [PATCH] fix: add default behavior --- ui/lib/main.dart | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ui/lib/main.dart b/ui/lib/main.dart index 165f4b9..a7f6814 100644 --- a/ui/lib/main.dart +++ b/ui/lib/main.dart @@ -60,7 +60,7 @@ class _MyAppState extends ConsumerState { ); }, branches: [ - StatefulShellBranch(routes: [ + StatefulShellBranch(initialLocation: WelcomePage.routeTv, routes: [ GoRoute( path: WelcomePage.routeTv, pageBuilder: (context, state) => buildPageWithDefaultTransition( @@ -81,7 +81,7 @@ class _MyAppState extends ConsumerState { child: SearchPage(query: state.uri.queryParameters["query"])), ), ]), - StatefulShellBranch(routes: [ + StatefulShellBranch(initialLocation: WelcomePage.routeMoivie, routes: [ GoRoute( path: WelcomePage.routeMoivie, pageBuilder: (context, state) => buildPageWithDefaultTransition( @@ -249,7 +249,9 @@ class _MainSkeletonState extends State { ), useDrawer: false, selectedIndex: widget.body.currentIndex, - onSelectedIndexChange: (p0) => widget.body.goBranch(p0), + onSelectedIndexChange: (p0) => widget.body + .goBranch(p0, initialLocation: p0 == widget.body.currentIndex), + destinations: const [ NavigationDestination( icon: Icon(Icons.live_tv_outlined),