Skip to content

Comments

Add mainAxisSize property for flexible sizing#423

Open
ArAmM7 wants to merge 1 commit intoadar2378:mainfrom
ArAmM7:main
Open

Add mainAxisSize property for flexible sizing#423
ArAmM7 wants to merge 1 commit intoadar2378:mainfrom
ArAmM7:main

Conversation

@ArAmM7
Copy link
Contributor

@ArAmM7 ArAmM7 commented Feb 23, 2026

Exposes the mainAxisSize property on MaterialPinField, MaterialPinFormField, and MaterialPinRow, which was previously hardcoded to MainAxisSize.min.

This allows users to set MainAxisSize.max so that mainAxisAlignment values like spaceBetween and spaceEvenly work as expected when the row should fill available width.

Defaults to MainAxisSize.min — no breaking changes.

Copilot AI review requested due to automatic review settings February 23, 2026 11:40
Copy link

Copilot AI left a comment

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 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 mainAxisSize parameter with default value MainAxisSize.min to 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.

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.

1 participant