I am creating a Flutter app. i made the design like this.
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.
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.
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() .
Just adjust the contentPadding in InputDecoration.
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)), ), );
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With