diff --git a/lib/pages/main/view.dart b/lib/pages/main/view.dart index b338b8475..c841ef9cc 100644 --- a/lib/pages/main/view.dart +++ b/lib/pages/main/view.dart @@ -39,10 +39,9 @@ class _MainAppState extends State with SingleTickerProviderStateMixin { _mainController.pageController = PageController(initialPage: _mainController.selectedIndex); enableMYBar = setting.get(SettingBoxKey.enableMYBar, defaultValue: true); - useSideBar = - setting.get(SettingBoxKey.useSideBar, defaultValue: false); - enableGradientBg = setting.get(SettingBoxKey.enableGradientBg, - defaultValue: true); + useSideBar = setting.get(SettingBoxKey.useSideBar, defaultValue: false); + enableGradientBg = + setting.get(SettingBoxKey.enableGradientBg, defaultValue: true); } void setIndex(int value) async { @@ -152,7 +151,7 @@ class _MainAppState extends State with SingleTickerProviderStateMixin { children: [ if (useSideBar) ...[ SizedBox( - width: 55, + width: 55 + MediaQuery.of(context).padding.left, child: NavigationRail( groupAlignment: 0.0, minWidth: 40.0, @@ -170,8 +169,11 @@ class _MainAppState extends State with SingleTickerProviderStateMixin { DynamicBadgeMode.number ? Text(e['count'].toString()) : null, - padding: - const EdgeInsets.fromLTRB(2, 0, 2, 0), + padding: EdgeInsets.fromLTRB( + 2 + MediaQuery.of(context).padding.left, + 0, + 2, + 0), isLabelVisible: _mainController.dynamicBadgeType != DynamicBadgeMode.hidden && diff --git a/lib/pages/rank/view.dart b/lib/pages/rank/view.dart index 4dc1ef340..f240c4a87 100644 --- a/lib/pages/rank/view.dart +++ b/lib/pages/rank/view.dart @@ -88,33 +88,44 @@ class _RankPageState extends State child: ConstrainedBox( constraints: BoxConstraints(minHeight: constraint.maxHeight), child: IntrinsicHeight( - child: NavigationRail( - backgroundColor: Colors.transparent, - minWidth: 50.0, - // elevation: 0, - selectedIndex: _selectedTabIndex, - onDestinationSelected: (int index) { - feedBack(); - if (_selectedTabIndex == index) { - _rankController.tabsCtrList[index]().animateToTop(); - } else { - setState(() { - _rankController.tabController.index = index; - _selectedTabIndex = index; - }); - } - }, - labelType: NavigationRailLabelType.none, - destinations: [ - for (var tab in _rankController.tabs) - NavigationRailDestination( - icon: Text(tab['label']), - // selectedIcon: Text(tab['label']), - label: const SizedBox.shrink(), - ), - ], - trailing: const SizedBox(height: 100), - )))); + child: MediaQuery.removePadding( + context: context, + removeLeft: true, + removeRight: true, + removeTop: true, + child: NavigationRail( + groupAlignment: -1.0, + backgroundColor: Colors.transparent, + minWidth: 40.0, + useIndicator: false, + // elevation: 0, + selectedIndex: _selectedTabIndex, + onDestinationSelected: (int index) { + feedBack(); + if (_selectedTabIndex == index) { + _rankController.tabsCtrList[index]() + .animateToTop(); + } else { + setState(() { + _rankController.tabController.index = index; + _selectedTabIndex = index; + }); + } + }, + labelType: NavigationRailLabelType.none, + destinations: [ + for (var tab in _rankController.tabs) + NavigationRailDestination( + icon: Padding( + padding: const EdgeInsets.symmetric( + vertical: 4), + child: Text(tab['label'])), + // selectedIcon: Text(tab['label']), + label: const SizedBox.shrink(), + ), + ], + trailing: const SizedBox(height: 100), + ))))); }), Expanded( child: TabBarView( diff --git a/lib/pages/rank/zone/view.dart b/lib/pages/rank/zone/view.dart index 526e549be..b9eb7ee6c 100644 --- a/lib/pages/rank/zone/view.dart +++ b/lib/pages/rank/zone/view.dart @@ -85,7 +85,7 @@ class _ZonePageState extends State SliverPadding( // 单列布局 EdgeInsets.zero padding: - const EdgeInsets.fromLTRB(StyleString.safeSpace, StyleString.safeSpace, 0, 0), + const EdgeInsets.fromLTRB(StyleString.cardSpace, StyleString.safeSpace, 0, 0), sliver: FutureBuilder( future: _futureBuilderFuture, builder: (context, snapshot) {