How to change color of particular text in a text field dynamically?

后端 未结 2 1733
你的背包
你的背包 2020-12-11 03:31

Consider bellow image, I want to dynamically change the text color of part of the text based on the user input text (not the whole text) in a text field. How can i do that i

2条回答
  •  情话喂你
    2020-12-11 04:03

    you can use simply style in Text Widget

    Text("value",style: TextStyle(color: Colors.purple)),
    

    or if you want to color a specific value in a line then use a row with multiple TextWidgets and give one of the color example

     Row(children: [
          Text("see this")),
          Text("@tammyDelgado",style: TextStyle(color: Colors.purple)),
          Text("Wonderfull")),
        ]),
    

提交回复
热议问题