andrew
andrew

Reputation: 939

How to set Flutter Text line space?

I had developing app using Android, now I use Flutter, but I want to find the property of Text that is same to android:includeFontPadding and android:lineSpacingExtra?

Upvotes: 93

Views: 129511

Answers (3)

Try the following code:

Text(
  "Your text",
  style: TextStyle(height: 1.5),
),

Upvotes: 7

Terry
Terry

Reputation: 1570

There are 2 properties you can set

Text("Hello World", style: TextStyle(
  height: 1.2 // the height between text, default is null
  letterSpacing: 1.0 // the white space between letter, default is 0.0
));

Upvotes: 80

bytesizedwizard
bytesizedwizard

Reputation: 6033

It looks like you looking for the height property of the TextStyle class. Here is an example:

Text(
  "Some lines of text",
  style: TextStyle(
    fontSize: 14.0,
    height: 1.5 //You can set your custom height here
  )
)

Upvotes: 205

Related Questions