code:
TextField(
maxLines:null,
decoration: InputDecoration(
suffixIcon: Icon(Icons.delete),
),
)
Everytime a new line is inserted, the icon centers itself.
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
Here is what I achieved using Padding around Icon:
Container(
height: 100,
child: TextField(
expands: true,
maxLines: null,
decoration: InputDecoration(
suffixIcon: Padding(
padding:
const EdgeInsets.only(left: 0, top: 0, right: 0, bottom: 100),
child: Icon(Icons.add),
)),
),
)