Add mainAxisSize property for flexible sizing#423
Open
ArAmM7 wants to merge 1 commit intoadar2378:mainfrom
Open
Add mainAxisSize property for flexible sizing#423ArAmM7 wants to merge 1 commit intoadar2378:mainfrom
ArAmM7 wants to merge 1 commit intoadar2378:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a mainAxisSize property to MaterialPinField, MaterialPinFormField, and MaterialPinRow widgets to allow control over horizontal space allocation. Previously, the row size was hardcoded to MainAxisSize.min. The new property defaults to MainAxisSize.min (preserving backward compatibility) but can be set to MainAxisSize.max to make the row expand and fill available width, enabling proper use of spacing alignments like spaceBetween and spaceEvenly.
Changes:
- Added
mainAxisSizeparameter with default valueMainAxisSize.minto MaterialPinRow, MaterialPinField, and MaterialPinFormField - Added comprehensive test coverage verifying default behavior, property pass-through, and layout behavior for both min and max values
- Minor formatting improvement in test file (removed unnecessary line break)
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/pin_code_fields/lib/src/material/layout/material_pin_row.dart | Base widget: replaced hardcoded MainAxisSize.min with mainAxisSize property parameter |
| packages/pin_code_fields/lib/src/material/material_pin_field.dart | Added mainAxisSize property and passed it through to MaterialPinRow |
| packages/pin_code_fields/lib/src/material/form/material_pin_form_field.dart | Added mainAxisSize property and passed it through to MaterialPinRow |
| packages/pin_code_fields/test/material_pin_field_test.dart | New test file with comprehensive tests for mainAxisSize behavior |
| packages/pin_code_fields/test/material_pin_form_field_test.dart | Added mainAxisSize test group and minor formatting fix |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Exposes the
mainAxisSizeproperty onMaterialPinField,MaterialPinFormField, andMaterialPinRow, which was previously hardcoded toMainAxisSize.min.This allows users to set
MainAxisSize.maxso thatmainAxisAlignmentvalues likespaceBetweenandspaceEvenlywork as expected when the row should fill available width.Defaults to
MainAxisSize.min— no breaking changes.