0
votes

I'm starting to transition my code from using standard Android libraries, into Flutter, so I can rapidly deploy onto iOS devices as well, but I just have a concern about the proportions of the TextField; namely that the proportions of Flutter's TextField differs from the EditText of Android.

To compare, here's Android's EditText:

Example of Android's EditText view.

and here's Flutter's TextField:

Example of Flutter's TextField widget.

Is there a way to make the Flutter TextField look more like the Android EditText? The space between the underline and the placeholder text annoys me, and the size of the input text is smaller than I expected. If the RaisedButton looks exactly like the normal Android Button, why can't TextField do the same?

1

1 Answers

2
votes

Set the isDense: true in InputDecoration. Then adjust contentPadding in InputDecoration as you want

TextField(
  decoration: InputDecoration(
    hintText: "Username",
    isDense: true,
    contentPadding: EdgeInsets.symmetric(  //You can also use EdgeInsets.only 
      horizontal: 0.0, //Change this 
      vertical: 0.0, //Change this 
    ),
  ),
)

See demo here