code:
TextField(
maxLines:null,
decoration: InputDecoration(
suffixIcon: Icon(Icons.delete),
),
)
Everytime a new line is inserted, the icon centers itself.
I found a work-around. Just use suffix
property of TextField
instead of suffixIcon
code:
TextField(
maxLines:null,
decoration: InputDecoration(
suffix: Icon(Icons.delete),
),
)
output:
Note: This solution may affect the design of your TextField
and the Icon
is not visible when TextField
is not focused or when it has no data