How to reduce padding between label text and bottom line in TextformField in Flutter?
1,127
Solution 1
With InputDecorationTheme
you can style TextformField
like you want. Also the padding.
Check this out: https://api.flutter.dev/flutter/material/InputDecorationTheme-class.html
MaterialApp(
theme: ThemeData(
inputDecorationTheme: InputDecorationTheme(
border: OutlineInputBorder(),
contentPadding: EdgeInsets.symmetric(
vertical: 22,
horizontal: 26,
),
labelStyle: TextStyle(
fontSize: 35,
decorationColor: Colors.red,
),
),
)
Solution 2
You should use contentPadding parameter inside TextField's decoration.For example:
TextField(
decoration:InputDecoration(
hintText:"LABEL",
contentPadding: EdgeInsets.only(top:0.0,bottom:0.0)
),
),
You can set content Padding as you like to achieve desired results.
Author by