Reputation: 475
RichText(
text: TextSpan(
text: 'NEW USER ?',
style: TextStyle(color: Colors.grey),
children: <TextSpan>[
TextSpan(
text: ' SIGN UP',
style: TextStyle(color: Colors.blue),
)
],
),
),
Here, I wanna do something when the "SIGN UP" is tapped.
Upvotes: 2
Views: 1689
Reputation: 11669
TextSpan
has recognizer
property to tap on the given widget.
TextSpan(
text: ' SIGN UP',
style: TextStyle(color: Colors.blue),
)
recognizer: TapGestureRecognizer()
..onTap = () {
// do something here
}),
)
Upvotes: 5