在颤振中的文本小部件中显示字符

时间:2021-04-19 11:16:46

标签: flutter flutter-web

如何在 Flutter 的文本小部件中显示类似内容?enter image description here

1 个答案:

答案 0 :(得分:2)

您可以使用 RichText ,提供圆点作为圆形头像和其他 2 个小部件您想要的文本。

                RichText(
            text:TextSpan(
              children:[
                TextSpan(
                  text:"Mon, 19 April ",
                  style:TextStyle(
                    color:Colors.blueAccent,
                  ),
                ),
                WidgetSpan(
                  child: Padding(
                    padding: EdgeInsets.symmetric(vertical:5.0,),
                    child: CircleAvatar(
                      radius:3,
                      backgroundColor:Colors.blueAccent,
                    ),
                  ),
                ),
                TextSpan(
                  text:" 06:00 PM",
                  style:TextStyle(
                    color:Colors.blueAccent,
                  ),
                ),
              ]
            ),
          ),

希望它对你有用。