How to add letter spacing in textfieldform widget just like in Text widget there is an option of letter spacing.
right aligns the text left and right inside its boundaries respectively. TextAlign. justify horizontally justifies the text over its container. textDirection: textDirection is used to specify the direction of the text inside a Text Widget say ltr (left-to-right) or rtl (right to left).
If you want letter spacing in normal text, use style property as shown below:
TextFormField(
style: TextStyle(
letterSpacing: 2.0,
),
),
If you want letter spacing in label text, use labelstyle property in input decoration as shown below
TextFormField(
decoration: InputDecoration(
labelText: 'Test',
labelStyle: TextStyle(
letterSpacing: 2.0,
),
),
),
In the same way you can style hint text too using hint style property.
Use the TextStyle
widget:
TextFormField(
style : TextStyle(letterSpacing : 2.0),
// The validator receives the text that the user has entered.
validator: (value) {
if (value.isEmpty) {
return 'Please enter some text';
}
return null;
},
),
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