例如:
String desc = "<bold>Hello<bold> World";
new Text(desc);
例如:
String desc = "<bold>Hello<bold> World";
new Text(desc);
您可以使用flutter_html_view套餐.
String html = '<bold>Hello<bold> World';
个
new HtmlTextView(data: html);
如果您只是想要不同的样式,您可以使用TextSpans
的RichText
小部件,比如this.
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!'),
], ), )