1. 程式人生 > 實用技巧 >flutter 實現 文字中插入圖示並能夠點選

flutter 實現 文字中插入圖示並能夠點選

Container(
                                  padding:
                                      EdgeInsets.only(left: 8.0, right: 12.0),
                                  child: Text.rich(
                                    TextSpan(
                                      style: TextStyle(
                                        fontSize: 
12, ), recognizer: TapGestureRecognizer() ..onTap = () async { print('-->>>>>>>>>-'); }, children: [ TextSpan( text:
'如客戶是你的微信好友,可複製暱稱到微信搜尋,開啟會話。 ', style: TextStyle( fontSize: 12.0, color: Color(0xB2FFFFFF))), WidgetSpan( child: SizedBox( height:
23.0, width: 23.0, child:InkWell( onTap: (){ print('---------------------'); }, child: Card( child: Center( child: Icon( IconData(0xe63c, fontFamily: 'saas'), size: 12.0, color: Colors.black, ), )), ) )) ], ), ) // Text( // "如客戶是你的微信好友,可複製暱稱到微信搜尋,開啟會話。", // style: TextStyle( // fontSize: 12.0, color: Color(0xB2FFFFFF)), // ), )),

效果