'Flutter- Reduce padding between hintText and suffixIcon for TextFormField
I have a TextFormField with hintText and suffixIcon. Currently the hint text is overflowing with ellipsis indication. There is a lot of space between hint text and the suffix icon which I want to reduce or at least remove the overflow and show the text completely.
I tried to achieve this with setting the hintStyle property by making the overflow visible, but still the ellipsis is appearing. How can we resolve this?
TextFormField(
initialValue:'Value',
onTap:() {},
decoration: InputDecoration(
hintText:'Select Date',
hintStyle: const TextStyle(overflow: TextOverflow.visible),
isDense: true,
suffixIcon: suffixIcon,
suffixIconConstraints: const BoxConstraints(
minWidth: 25,
minHeight: 25,
),
),
),
Solution 1:[1]
Try below code hope its help to you. Try to add hintMaxLines,
TextFormField(
// initialValue:'Value',
onTap:() {},
decoration: InputDecoration(
hintText:'Some Text',
hintMaxLines: 2,
hintStyle: const TextStyle(overflow: TextOverflow.visible),
isDense: true,
suffixIcon: Icon(Icons.date_range),
suffixIconConstraints: const BoxConstraints(
minWidth: 25,
minHeight: 25,
),
),
),
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Ravindra S. Patil |


