-
Notifications
You must be signed in to change notification settings - Fork 26.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vertical Alignment of Icon in a TextField #42651
Comments
#42936 does not mention this issue at all. Would be awesome to have for suffix icon as well |
This comment has been minimized.
This comment has been minimized.
I am also facing this issue, I have also the requirement to set prefix icon to be top-aligned with its text. I request to the core team, please add this feature in this API. |
I solved this problem by adding a Padding to the Icon. |
using |
im also having this issue, padding worked for me.
8 because my container have height: 38 |
Any update? |
Is there any solution? |
any news about this issue? |
Default suffixIcon implementation in the doc Here is my solution:
Simple |
I manage to solve this by adding proper bottom padding
|
Any Update on this topic? |
I just fix this issue. Just only use prefixIcon property instead of prefix property and use TextAlignVertical.center for textAlignVertical |
Note that using Any solution using paddings, margins, etc won't work for other users with different values. This is especially problematic when building a widget library where the user is expected to have any arbitrary value. The solution needs to come on the flutter side where the |
This is now documented in #91998, you can get the desired alignment using the |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
Use case
I have a form and below it, I have an expandable details field (it's a shame that I can't do it with a TextFormField but that's for another time). I vertically aligned the text to the top using
textAlignVertical: TextAlignVertical.top
but I can't do the same for theprefixIcon
.Here's the code I used to make this field:
Proposal
It would be great if there was a property when you style the prefix or suffix icon that can vertically align it in an expandable text field so that the text and icon aren't misaligned.
The text was updated successfully, but these errors were encountered: