Reputation: 701
How to add letter spacing in textfieldform widget just like in Text widget there is an option of letter spacing.
Upvotes: 20
Views: 21701
Reputation: 80914
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;
},
),
Upvotes: 6
Reputation: 1122
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.
Upvotes: 31