我需要为 TextField() 的 labelText 设置两种不同的颜色。我有一个实现 TextField 的功能请求,其标题将显示为“必需*”,但我需要为标签文本设置两种不同的颜色,例如“必需”为绿色,仅“*”为红色。
TextField(
controller: _controller,
decoration: new InputDecoration(
hintText: 'Search here',
labelStyle: TextStyle(),
labelText: 'Required*' //make 'Required' green and '*' red color
),
onChanged: (str) {
//need to implement debounce
}
)