我在 flutter 中看到了这段富文本代码:
return Row(
children: <Widget>[
?
Container(
child: RichText(
text: TextSpan(
text: "Hello",
style: TextStyle(fontSize: 20.0,color: Colors.black),
children: <TextSpan>[
TextSpan(text:"Bold"),
style: TextStyle( fontSize: 10.0, color: Colors.grey),
),
],
),
),
)
Run Code Online (Sandbox Code Playgroud)
这个印刷品
Hellobold
Run Code Online (Sandbox Code Playgroud)
但我需要将两个文本分开,一个向左,另一个向右,就像这样
Hello bold
Run Code Online (Sandbox Code Playgroud)
我该怎么做?
谢谢
flutter ×1