From c1146f0ab8f0457c2d40f4921392c8357f56df64 Mon Sep 17 00:00:00 2001 From: mohammadreza Date: Sat, 10 Jul 2021 13:02:29 +0430 Subject: [PATCH] fixed bottom_navy_bar --- example/lib/main.dart | 2 +- lib/bottom_navy_bar.dart | 13 ++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/example/lib/main.dart b/example/lib/main.dart index dfdffb1..a20a3cd 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -52,7 +52,7 @@ class _MyHomePageState extends State { bottomNavigationBar: BottomNavyBar( selectedIndex: _currentIndex, showElevation: true, - itemCornerRadius: 24, + itemCornerRadius: 12, curve: Curves.easeIn, onItemSelected: (index) => setState(() => _currentIndex = index), items: [ diff --git a/lib/bottom_navy_bar.dart b/lib/bottom_navy_bar.dart index 97ab25b..c3ab9d9 100644 --- a/lib/bottom_navy_bar.dart +++ b/lib/bottom_navy_bar.dart @@ -132,7 +132,7 @@ class _ItemWidget extends StatelessWidget { container: true, selected: isSelected, child: AnimatedContainer( - width: isSelected ? 130 : 50, + width: 100, height: double.maxFinite, duration: animationDuration, curve: curve, @@ -145,8 +145,8 @@ class _ItemWidget extends StatelessWidget { scrollDirection: Axis.horizontal, physics: NeverScrollableScrollPhysics(), child: Container( - width: isSelected ? 130 : 50, - padding: EdgeInsets.symmetric(horizontal: 8), + width: 100, + padding: EdgeInsets.symmetric(horizontal: 2), child: Row( mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.start, @@ -163,10 +163,9 @@ class _ItemWidget extends StatelessWidget { ), child: item.icon, ), - if (isSelected) - Expanded( + Expanded( child: Container( - padding: EdgeInsets.symmetric(horizontal: 4), + padding: EdgeInsets.symmetric(horizontal: 3), child: DefaultTextStyle.merge( style: TextStyle( color: item.activeColor, @@ -177,7 +176,7 @@ class _ItemWidget extends StatelessWidget { child: item.title, ), ), - ), + ), ], ), ),