How to set Flutter Text line space?

Flutter

Flutter Problem Overview


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?

Flutter Solutions


Solution 1 - Flutter

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
  )
)

Solution 2 - Flutter

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
));

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionandrewView Question on Stackoverflow
Solution 1 - FlutterthedarthcoderView Answer on Stackoverflow
Solution 2 - FlutterTerryView Answer on Stackoverflow