Bruno Leroux ee3551fbe4
Fix InputDecorator label padding (#173344)
## Description

This PR fixes the label padding for an InputDecorator with prefixIcon
and/or suffixIcon.

# Before

The label was shorter than the available space because
`InputDecoration.contentPadding.horizontal` was applied even when
`prefixIcon` and `suffixIcon` were defined. The icons width replaces the
corresponding `contentPadding`, so both should not be used at the same
time to compute the available space.

<img width="269" height="61" alt="image"
src="https://github.com/user-attachments/assets/e1433ffb-8f17-46fe-9a65-6b9a504ef043"
/>

# After

The label takes all the available space.

<img width="269" height="61" alt="image"
src="https://github.com/user-attachments/assets/12e8d087-c75b-48c9-8df4-1b11207c0e73"
/>


## Related Issue

Fixes [Label padding is wrong for InputDecorator with prefixIcon and/or
suffixIcon ](https://github.com/flutter/flutter/issues/173341)

## Tests

Adds 1 test.
2025-08-14 17:38:02 +00:00
..
2025-07-22 17:51:20 +00:00

Flutter

Flutter is a new way to build high-performance, cross-platform mobile, web, and desktop apps. Flutter is optimized for today's — and tomorrow's — mobile and desktop devices. We are focused on low-latency input and high frame rates on all platforms.

See the getting started guide for information about using Flutter.