如何在Flutter中的TextFormField标签中添加红色星号
hxzsmxv21#
Using this code you can achieve that kind of styling in flutter. TextField( decoration: InputDecoration( hintText: 'Ciao', suffixText: '*', suffixStyle: TextStyle( color: Colors.red, ), ), ),
f0ofjuux2#
尝试为标签文本使用RichText
decoration: InputDecoration( label: Text.rich(TextSpan(children: [ TextSpan(text: 'ThisIsLabelText'), TextSpan(text: ' *', style: TextStyle(color: Colors.red)), ])) ),
2条答案
按热度按时间hxzsmxv21#
f0ofjuux2#
尝试为标签文本使用RichText