nyp*_*ogi 6 string dart flutter
例如 :
String desc = "<bold>Hello<bold> World";
new Text(desc);
Run Code Online (Sandbox Code Playgroud)
您可以为此使用flutter_html_view包。
String html = '<bold>Hello<bold> World';
new HtmlTextView(data: html);
如果你只是想不同的风格,你可以使用一个RichText小部件,TextSpans像这样。
new RichText( text: new TextSpan(text: 'Hello ', style: DefaultTextStyle.of(context).style, children:
<TextSpan>[
new TextSpan(text: 'bold', style: new TextStyle(fontWeight: FontWeight.bold)),
new TextSpan(text: ' world!'),
], ), )
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2196 次 |
| 最近记录: |