I am defining a string and now I want to set my string a color, please show how do I do that with my code
final String followOnLabel = inningScore.followOn! ? ' (f/o)' : '';
I want to set my string followOnLabel color or textstyle. Thank you in advance.
2
Answers
Strings are text. They don’t have colors. Widgets have colors. To give a
Text
widget a red text you could write this for example:@SaDev As I understand, do you want to change the colour of your string depending on the condition? If yes then the below code will help you to meet your requirements.