From 26f842b01d6c7483098e5e2c3470f0d7ca6a4bc8 Mon Sep 17 00:00:00 2001 From: Paul Kepinski Date: Thu, 6 Oct 2022 12:40:14 +0200 Subject: [PATCH] Add padding top and adjust font-size --- .../pages/layouts/yaru_navigation_rail.dart | 33 ++++++++++--------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/lib/src/pages/layouts/yaru_navigation_rail.dart b/lib/src/pages/layouts/yaru_navigation_rail.dart index 530ed1be..12091a25 100644 --- a/lib/src/pages/layouts/yaru_navigation_rail.dart +++ b/lib/src/pages/layouts/yaru_navigation_rail.dart @@ -20,18 +20,21 @@ class YaruNavigationRail extends StatelessWidget { @override Widget build(BuildContext context) { - return Column( - children: [ - for (int i = 0; i < destinations.length; i += 1) - _YaruNavigationRailItem( - i, - i == selectedIndex, - destinations[i], - onDestinationSelected, - showLabels, - showLabels && extended, - ) - ], + return Padding( + padding: const EdgeInsets.symmetric(vertical: 5), + child: Column( + children: [ + for (int i = 0; i < destinations.length; i += 1) + _YaruNavigationRailItem( + i, + i == selectedIndex, + destinations[i], + onDestinationSelected, + showLabels, + showLabels && extended, + ) + ], + ), ); } } @@ -67,7 +70,7 @@ class _YaruNavigationRailItem extends StatelessWidget { child: Center( child: Padding( padding: EdgeInsets.symmetric( - vertical: extended ? 10 : 8, + vertical: extended ? 10 : 5, horizontal: extended ? 8 : 5, ), child: _columnOrRow([ @@ -131,8 +134,8 @@ class _YaruNavigationRailItem extends StatelessWidget { if (label is YaruPageItemTitle) { label = DefaultTextStyle.merge( child: label, - style: const TextStyle( - fontSize: 13, + style: TextStyle( + fontSize: extended ? 13 : 12, fontWeight: FontWeight.w500, ), overflow: TextOverflow.ellipsis,