Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minimized the space between the icon and the title #112

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions lib/bottom_navy_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ class BottomNavyBar extends StatelessWidget {

@override
Widget build(BuildContext context) {
final bgColor = backgroundColor ?? (Theme.of(context).bottomAppBarTheme.color ?? Colors.white);
final bgColor = backgroundColor ??
(Theme.of(context).bottomAppBarTheme.color ?? Colors.white);

return Container(
decoration: BoxDecoration(
Expand Down Expand Up @@ -175,10 +176,12 @@ class _ItemWidget extends StatelessWidget {
scrollDirection: Axis.horizontal,
physics: NeverScrollableScrollPhysics(),
child: Container(
width: isSelected ? 130 : 50,
// Remove fixed width, let it adjust based on content
// width: isSelected ? 130 : 50, // Limit the width here
padding: EdgeInsets.symmetric(horizontal: 8),
child: Row(
mainAxisSize: MainAxisSize.max,
mainAxisSize: MainAxisSize
.min, // Change to MainAxisSize.min to reduce space
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expand All @@ -194,9 +197,9 @@ class _ItemWidget extends StatelessWidget {
child: item.icon,
),
if (isSelected)
Expanded(
child: Container(
padding: itemPadding,
Container(
padding:
EdgeInsets.only(left: 4), // Adjust left padding here
child: DefaultTextStyle.merge(
style: TextStyle(
color: item.activeColor,
Expand All @@ -205,9 +208,7 @@ class _ItemWidget extends StatelessWidget {
maxLines: 1,
textAlign: item.textAlign,
child: item.title,
),
),
),
)),
],
),
),
Expand Down