I'm trying to change the color of the Register button in the "don't have an account? Register" widget in the FlutterFireUI loginScreen page
I thought it was a TextButton at first like the forget password button so I added the following code inside the ThemeData widget for the MaterialApp
textButtonTheme: TextButtonThemeData(
style: TextButton.styleFrom(
foregroundColor: Color(0xFF6F73D2),// Text Color
),
),
but it turned out to be a RichText widget instead
I looked online for hours but I can't find how to change its color
CodePudding user response:
Try this code
RichText(
text: const TextSpan(
children: <TextSpan>[
TextSpan(text: "Don't have an account? ", style: TextStyle(color: Colors.black)),
TextSpan(
text: ' Register',
style: TextStyle(fontWeight: FontWeight.bold, color: Colors.blue)),
],
),
),
CodePudding user response:
RichText(
text: TextSpan(
text: "Don't have an account? ",
style: TextStyle(color: Colors.black),
children: [
TextSpan(
text: ' Register',
style: TextStyle(
fontWeight: FontWeight.bold,
color: Color(0xFF6F73D2),
),
recognizer: TapGestureRecognizer()
..onTap = () {
//BUTTON ACTION
},
),
],
),
),