如何设置Flutter Text行间距?

时间:2019-03-18 06:04:04

标签: flutter

我曾经使用Android开发应用程序,现在我使用Flutter,但我想查找与'android:includeFontPadding'和'android:lineSpacingExtra'相同的Text属性

2 个答案:

答案 0 :(得分:3)

看起来您正在寻找height类的TextStyle属性。 这是一个示例:

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

答案 1 :(得分:0)

您可以设置2个属性

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