Skip to content

feat: add iconAlignment - #29

Merged
tilucasoli merged 3 commits into
mainfrom
feat-add-icon-alignment
Jan 7, 2026
Merged

feat: add iconAlignment#29
tilucasoli merged 3 commits into
mainfrom
feat-add-icon-alignment

Conversation

@tilucasoli

@tilucasoli tilucasoli commented Jan 7, 2026

Copy link
Copy Markdown
Collaborator

Description

This PR adds the ability to control icon alignment in the RemixButton component, allowing icons to be positioned either before (start) or after (end) the button label.

Key Changes

Added iconAlignment property to RemixButtonSpec with a default value of IconAlignment.start
Added iconAlignment() method to RemixButtonStyle for fluent API usage
Refactored button_widget.dart to conditionally order icon and text based on alignment setting


Checklist

Note: Updating the pubspec.yaml and CHANGELOG.md is not required. These are handled automatically during the release process.

  • My PR includes unit or integration tests for all changed/updated/fixed behaviors.
  • I have updated or added relevant documentation (doc comments with ///).
  • I am prepared to follow up on review comments in a timely manner.

Breaking Change

Does this PR require users of the package to manually update their code?

  • Yes, this is a breaking change.
  • No, this is not a breaking change.

@tilucasoli
tilucasoli requested a review from Copilot January 7, 2026 17:27
@docs-page

docs-page Bot commented Jan 7, 2026

Copy link
Copy Markdown

To view this pull requests documentation preview, visit the following URL:

docs.page/btwld/remix~29

Documentation is deployed and generated using docs.page.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR adds the ability to control icon alignment in the RemixButton component, allowing icons to be positioned either before (start) or after (end) the button label.

Key Changes

  • Added iconAlignment property to RemixButtonSpec with a default value of IconAlignment.start
  • Added iconAlignment() method to RemixButtonStyle for fluent API usage
  • Refactored button_widget.dart to conditionally order icon and text based on alignment setting

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
button_spec.dart Adds iconAlignment field to the spec with default value, updates constructor, copyWith, lerp, diagnostics, and equality
button_style.dart Adds iconAlignment parameter to style constructors and provides fluent API method for setting alignment
button_widget.dart Implements icon alignment logic using switch expression and refactors spinner creation (removes unnecessary Center wrapper)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/remix/lib/src/components/button/button_spec.dart
Comment thread packages/remix/lib/src/components/button/button_style.dart Outdated
Comment thread packages/remix/lib/src/components/button/button_spec.dart
tilucasoli and others added 2 commits January 7, 2026 14:33
Added checks for the new iconAlignment property in the RemixButtonSpec tests, updating property counts and assertions to ensure full coverage.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@tilucasoli
tilucasoli merged commit 9dd2c75 into main Jan 7, 2026
2 checks passed
@tilucasoli
tilucasoli deleted the feat-add-icon-alignment branch January 7, 2026 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants