How can I change the color of part of a text?
I'm trying to make it so the text says "Don't have an account? Register now!
" but I want to add color to the Register now!
part. How can I do this if possible?
Use RichText
:
RichText(
text: TextSpan(
text: "Don't have an account? ",
style: TextStyle(color: Colors.black, fontSize: 40),
children: <TextSpan>[
TextSpan(text: ' Register now!', style: TextStyle(color: Colors.red)),
],
),
);