在Flutter中使用 TextStyle() 类,我如何通过旧价格进行攻击?
TextStyle()
您可以使用RichText widget设置段落的单独 Span 的样式 .
根据this example code,显示折扣价:
new RichText( text: new TextSpan( text: 'This item costs ', children: <TextSpan>[ new TextSpan( text: '$8.99', style: new TextStyle( color: Colors.gray, decoration: TextDecoration.lineThrough, ), ), new TextSpan( text: ' $3.99', ), ], ), )
style: TextStyle(decoration: TextDecoration.lineThrough),
2 回答
您可以使用RichText widget设置段落的单独 Span 的样式 .
根据this example code,显示折扣价: