From 42dc3d06eb8d7eb35e764d32e0e7c9dbf01e0a98 Mon Sep 17 00:00:00 2001 From: Simon Ding Date: Tue, 16 Jul 2024 22:50:53 +0800 Subject: [PATCH] fix --- ui/lib/navdrawer.dart | 94 ++++++++++++++++++++----------------------- 1 file changed, 43 insertions(+), 51 deletions(-) diff --git a/ui/lib/navdrawer.dart b/ui/lib/navdrawer.dart index cedabf0..70e075c 100644 --- a/ui/lib/navdrawer.dart +++ b/ui/lib/navdrawer.dart @@ -20,56 +20,48 @@ class _NavDrawerState extends State { @override Widget build(BuildContext context) { - return Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Flexible( - child: NavigationRail( - selectedIndex: _counter, - onDestinationSelected: (value) { - setState(() { - _counter = value; - }); - if (value == 0) { - context.go(MovieWatchlistPage.route); - } else if (value == 1) { - context.go(TvWatchlistPage.route); - } else if (value == 2) { - context.go(SearchPage.route); - } else if (value == 3) { - context.go(ActivityPage.route); - } else if (value == 4) { - context.go(SystemSettingsPage.route); - } - }, - extended: MediaQuery.of(context).size.width >= 850, - unselectedIconTheme: const IconThemeData(color: Colors.grey), - destinations: const [ - NavigationRailDestination( - icon: Icon(Icons.movie), - label: Text('电影'), - ), - NavigationRailDestination( - icon: Icon(Icons.live_tv), - label: Text('电视剧'), - ), - NavigationRailDestination( - icon: Icon(Icons.search), - label: Text('搜索'), - ), - NavigationRailDestination( - icon: Icon(Icons.download), - label: Text('活动'), - ), - NavigationRailDestination( - icon: Icon(Icons.settings), - label: Text('设置'), - ), - ], - //groupAlignment: -1, - minWidth: 56, - )) - ]); + return NavigationRail( + selectedIndex: _counter, + onDestinationSelected: (value) { + setState(() { + _counter = value; + }); + if (value == 0) { + context.go(MovieWatchlistPage.route); + } else if (value == 1) { + context.go(TvWatchlistPage.route); + } else if (value == 2) { + context.go(SearchPage.route); + } else if (value == 3) { + context.go(ActivityPage.route); + } else if (value == 4) { + context.go(SystemSettingsPage.route); + } + }, + extended: MediaQuery.of(context).size.width >= 850, + unselectedIconTheme: const IconThemeData(color: Colors.grey), + destinations: const [ + NavigationRailDestination( + icon: Icon(Icons.movie), + label: Text('电影'), + ), + NavigationRailDestination( + icon: Icon(Icons.live_tv), + label: Text('电视剧'), + ), + NavigationRailDestination( + icon: Icon(Icons.search), + label: Text('搜索'), + ), + NavigationRailDestination( + icon: Icon(Icons.download), + label: Text('活动'), + ), + NavigationRailDestination( + icon: Icon(Icons.settings), + label: Text('设置'), + ), + ], + ); } }