Alpit Panchal
Alpit Panchal

Reputation: 1037

How can remove Extra space in TextFormField Flutter

When I used the suffixIcon so space between hint text and underline is little bit show extra and without suffixIcon it's look perfect. if you see in below image I have used the suffixIcon in "New Password" and "Confirm Password" So there is little bit extra space between hint text and underline but in "Old Password" i have not use the suffixIcon So it's look perfect. I have also try with set suffixIcon size but it's not working, So please help me for how can I remove the extra space when using the suffixIcon?

You can see below with both code and UI.

enter image description here

Upvotes: 0

Views: 377

Answers (1)

Prashant
Prashant

Reputation: 676

Use contentPadding property of TextFormField to maintain equal amount of space regardless of if whether it has suffixIcon or not:

contentPadding:
              const EdgeInsets.symmetric(horizontal: 10, vertical: 12),

Upvotes: 1

Related Questions