Skip to content

refactor(style): make button spacing more proportional - #44

Merged
afonsocraposo merged 5 commits into
afonsocraposo:mainfrom
ryanaidilp:main
Oct 16, 2023
Merged

afonsocraposo merged 5 commits into
afonsocraposo:mainfrom
ryanaidilp:main

Conversation

@ryanaidilp

Copy link
Copy Markdown
Contributor

Pull Request Description

In this pull request, I've undertaken a significant style enhancement focused on creating a more visually harmonious user interface. The issue at hand was the irregular spacing between buttons caused by direct padding implementation. Previously, when padding was directly applied using EdgeInsets.all(16), it resulted in uneven distances between buttons, leading to an unbalanced layout:

Before:

16 -- First Tab -- 16 -- 16 -- Second Tab -- 16 -- 16 -- Last Tab -- 16

Simulator Screen Recording - iPhone 14 Pro Max - 2023-10-14 at 11 33 20

To rectify this, I've implemented a more precise logic to ensure proportional spacing between buttons. Through careful adjustments in the code, I've calculated margins dynamically based on the provided widget.buttonMargin values and the position of the button. This meticulous approach results in a visually appealing and symmetrical button layout:

After:

16 -- First Tab -- 8 - 8 -- Second Tab -- 8 - 8 -- Last Tab -- 16

Simulator Screen Recording - iPhone 14 Pro Max - 2023-10-14 at 11 33 56

By applying these changes, the spacing between buttons is now not only consistent but also proportionate, creating a more polished and aesthetically pleasing user interface. This enhancement significantly improves the overall user experience and aligns the application's visual elements with modern design standards.

Comment thread lib/buttons_tabbar.dart Resolved
Comment thread lib/buttons_tabbar.dart Outdated
Comment on lines +329 to +335
var margin = EdgeInsets.only(
top: widget.buttonMargin.top,
bottom: widget.buttonMargin.bottom,
left: widget.buttonMargin.left / 2,
right: widget.buttonMargin.right / 2,
);

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
var margin = EdgeInsets.only(
top: widget.buttonMargin.top,
bottom: widget.buttonMargin.bottom,
left: widget.buttonMargin.left / 2,
right: widget.buttonMargin.right / 2,
);
EdgeInsets margin;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implemented in 87ad9ff

@afonsocraposo

Copy link
Copy Markdown
Owner

Hey @ryanaidilp ! Thank you a lot for your contribution 🙏🏻
Can you please implement the suggestions above and bump the version number?

@afonsocraposo afonsocraposo added the enhancement New feature or request label Oct 16, 2023
@ryanaidilp

Copy link
Copy Markdown
Contributor Author

Hey @ryanaidilp ! Thank you a lot for your contribution 🙏🏻 Can you please implement the suggestions above and bump the version number?

Thank you for your feedback! I've implemented the suggestions and bumped the version number to 1.3.7+2 in my recent push. Please feel free to review it when you get a chance. Let me know if there's anything else I can assist with.

Comment thread pubspec.yaml Outdated
name: buttons_tabbar
description: A Flutter package that implements a TabBar where each label is a toggle button.
version: 1.3.7+1
version: 1.3.7+2

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please update it to 1.3.8 please?

Comment thread CHANGELOG.md Outdated
# CHANGELOG


## [1.3.7+2] - 16 October 2023

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please update it to 1.3.8 please?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noted, on my way

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated on e1e921d

@afonsocraposo
afonsocraposo merged commit 2564bfc into afonsocraposo:main Oct 16, 2023
@afonsocraposo

Copy link
Copy Markdown
Owner

Thank you a lot for your contribution @ryanaidilp !!! 🙇🏻

@ryanaidilp

Copy link
Copy Markdown
Contributor Author

Thank you a lot for your contribution @ryanaidilp !!! 🙇🏻

You're welcome! 😊 Thank you as well for creating this amazing package 👏👍

@afonsocraposo

Copy link
Copy Markdown
Owner

Thank you a lot for your contribution @ryanaidilp !!! 🙇🏻

You're welcome! 😊 Thank you as well for creating this amazing package 👏👍

No problem at all.
I have not been working in Flutter for more than one year, so it's really good that people like you still put the effort into this! 💪🏻

Btw, here's the link in pub.dev:
https://pub.dev/packages/buttons_tabbar/versions/1.3.8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants