Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter increase height of TextFormField

I am creating a Flutter app. i made the design like this. enter image description here

My TextFormField form field for email and password heights are small. I want it to be the same size of the button.

final email = TextFormField(     keyboardType: TextInputType.emailAddress,     autofocus: false,     initialValue: '[email protected]',      style: new TextStyle(fontWeight: FontWeight.normal, color: Colors.white),     decoration: InputDecoration(       hintText: 'Email',        contentPadding: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0),       border: OutlineInputBorder(         borderRadius: BorderRadius.circular(32.0)       ),     ),   ); 

Whats the syntax for the height in text form field.

like image 630
Sathya Baman Avatar asked May 25 '18 06:05

Sathya Baman


People also ask

How can I increase the height of my TextField?

TextField's height can be changed in 3 ways that are based on your requirement. You can use the Font Size and Content Padding to increase the height and allow a single-line text or use the MaxLines-MinLines property to increase the overall height of the TextField as new text is entered.

How do I increase the height of a TextField in Swift?

Step 1 : Click the Attribute Inspector, Select the Border Styles which is not the rounded one. Step 2 : Now go to Size Inspector and change the size of the TextField. Step 3 : Create an @IBOutlet for TextField and then add below code inside the viewWillAppear() or viewDidAppear() .


1 Answers

Just adjust the contentPadding in InputDecoration.

enter image description here

final email = TextFormField(     keyboardType: TextInputType.emailAddress,     autofocus: false,     initialValue: '[email protected]',     style: new TextStyle(fontWeight: FontWeight.normal, color: Colors.white),     decoration: InputDecoration(       hintText: 'Email',       contentPadding: const EdgeInsets.symmetric(vertical: 25.0, horizontal: 10.0),       border: OutlineInputBorder(borderRadius: BorderRadius.circular(32.0)),     ),   ); 
like image 73
Ajay Kumar Avatar answered Sep 19 '22 19:09

Ajay Kumar