flutterflutter-textinputfield

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


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.


Solution

  • 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