Vertically center text in text field in Flutter
You can try with contentPadding (.all or .only)
TextFormField(
...
decoration: InputDecoration(
contentPadding: EdgeInsets.all(10.0),
...
)
before
after
textAlignVertical.center work for me.
example:
TextFormField(
textAlignVertical: TextAlignVertical.center,
...
)
If you have a prefixIcon, setting isCollapsed to true is the trick.
TextField(
textAlignVertical: TextAlignVertical.center,
decoration: InputDecoration(
prefixIcon: Icon(...),
isCollapsed: true,
),
),