As we are not able to make widget like RichText/Text Span For styling TextFormField, How we can achieve a result like this? Can anyone help me out regarding this... thanks i
Simplest way, but not exactly equals:
TextField(
decoration: InputDecoration(
hintText: 'Ciao',
suffixText: '*',
suffixStyle: TextStyle(
color: Colors.red,
),
),
),
Or create a custom TextField
to use hint as Widget instead of String
You can use my two customized files:
TextFieldCustom(
hintText: Text.rich(
TextSpan(
text: 'FIRST NAME',
children: [
TextSpan(
text: '*',
style: TextStyle(color: Colors.red),
),
],
style: TextStyle(color: Colors.black54),
),
),
),