小编Jož*_* Ws的帖子

颤振富文本分离对齐

我在 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

8
推荐指数
2
解决办法
3万
查看次数

标签 统计

flutter ×1