flutter_stripe icon indicating copy to clipboard operation
flutter_stripe copied to clipboard

Unexpected behavior: enablePostalCode inside CardFormField leaves a blank space under the widget

Open blk-raffy opened this issue 1 year ago • 1 comments

Describe the bug By using the CardFormField widget, if you want to remove the postal code input, you can use the enablePostalCode. If you set enablePostalCode: false the input disappear correctly, but it leaves a blank space as the same size.

photo_2024-01-17_18-08-30

with enablePostalCode: true

photo_2024-01-17_18-08-23

with enablePostalCode: false

To Reproduce

CardFormField(
  autofocus: true,
  enablePostalCode: true,
  style: CardFormStyle(
    placeholderColor:
        ThemeColor.lightDark.withOpacity(0.3),
  ),
  onCardChanged: (card) {
    Debug.debug("Card changed");
  },
)

Expected behavior The input should be thrown away without leaving any blank space

Smartphone / tablet

  • Device: any
  • OS: Android and iOS
  • Package version: 10.0.0
  • Flutter version: 3.16.5 Channel Stable

Additional context Flutter doctor does not return any issue. There are no issues shown in the terminal. I think it's only a visual bug

blk-raffy avatar Jan 17 '24 17:01 blk-raffy