How can I change the height of a TextField in Flutter?

60 Views Asked by At

I want to change the height of a TextField in Flutter but I don't know which one is the best way.

  1. Wrap the TextField in a SizedBox
  2. Use content padding property

If you have some experience, please share it. I just want to know the differences.

2

There are 2 best solutions below

0
Andreas Hadjimamas On BEST ANSWER

Solution 1 const SizedBox(width: 100.0,child: TextField())

Solution 2

const TextField( decoration: InputDecoration( contentPadding:EdgeInsets.symmetric(vertical:40.0) ,) ,)

You can also edit the maxLines: property to make the box bigger

0
mashood pangat On

Both methods achieve the goal of changing the height of the TextField.I mostly used wrap with sizedbox.Height and width used mediaquery for responsive Ui.