In Flutter, we can change the height and width of a TextField widget using the decoration property and its contentPadding attribute.

Also we can adjust height and width using the SizedBox widget, by wrapping TextField inside it.

Eg. 1 :

const Center(
 child: SizedBox(
   width: 200.0,
   child: TextField(
     decoration: InputDecoration(
       contentPadding: EdgeInsets.symmetric(
         vertical: 25.0,
         horizontal: 10.0,
       ),
       border: OutlineInputBorder(),
       hintText: 'Enter text here',
     ),
   ),
 ),
),

 

Output:

Big Textfield

Eg. 2 :

const Center(
 child: SizedBox(
   width: 200.0,
   height: 30,
   child: TextField(
     decoration: InputDecoration(
       contentPadding: EdgeInsets.symmetric(horizontal: 10.0),
       border:  OutlineInputBorder(),
       hintText: 'Enter text here',
     ),
   ),
 ),
),

Output:

original textfield

Support On Demand!

Flutter