Fonts 如何在颤振中居中对齐文本?

Fonts 如何在颤振中居中对齐文本?,fonts,flutter,Fonts,Flutter,预期产出: 我的当前输出: 当前输出的代码: subtitle: Center(child: Text( "Hello, my name is Sam \n I am new here.", style: TextStyle(fontSize: 18, color: Colors.white), ), ), 您可以使用属性textAlign设置

预期产出:

我的当前输出:

当前输出的代码:

subtitle: Center(child: Text(
                    "Hello, my name is Sam \n I am new here.",
                    style: TextStyle(fontSize: 18, color: Colors.white),
                  ),
                ),

您可以使用属性
textAlign
设置
Text
对齐方式:

文本(
“你好,我叫萨姆\n我是新来的。”,
textAlign:textAlign.center,
样式:TextStyle(字体大小:18,颜色:Colors.white),
);
使用

subtitle: Center(child: Text(
                    "Hello, my name is Sam \n I am new here.",
                    textAlign: TextAlign.center,
                    style: TextStyle(fontSize: 18, color: Colors.white),
                  ),
                ),