How to show Icon in Text widget in flutter?

前端 未结 7 595
悲&欢浪女
悲&欢浪女 2020-12-28 13:24

I want to show an icon in text widget. How do I do this ?

The following code only shows the IconData

Text(\"Click ${Icons.add} to add\"         


        
7条回答
  •  感情败类
    2020-12-28 14:17

    Row Widget can be one solution for this issue, but you have to use different widgets to make it happen.

    Follow below example.

    Row(
       children: [
         Text("Hi"),
         Icon(Icons.add),
         Text("Hello")
       ]
     )
    

提交回复
热议问题