Want to make a line through text in Flutter? You can also style separate spans of a paragraph by using the RichText widget. Based on this example code, to show a discounted price:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | 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', ), ], ), ) |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.