0

How can I tap on the second Text Span area even if it has rich text property? I am new to flutter driver and I found out rich text not supported...

Padding(
      padding: const EdgeInsets.only(top: 16.0, bottom: 24.0),
      child: Text.rich(
        TextSpan(
          text: s.refill_description,
          style: primaryTextTheme.textSmall,
          children: [
            if (user.paymentDetails?.type == LegalEntityType.private)
              TextSpan(
                text: s.withdraw_label,
                style: primaryTextTheme.textSmall.copyWith(color: FlAppStyles.linkTextColor),
                recognizer: TapGestureRecognizer()..onTap = () => showRefundScreen(context),
              )
Adrian Mole
  • 49,934
  • 160
  • 51
  • 83
harusama
  • 1
  • 1

1 Answers1

2

You can do it like this

RichText(
  text: TextSpan(
    children: [
      TextSpan(
        text: 'Single tap',
        style: TextStyle(color: Colors.red[300]),
        recognizer: TapGestureRecognizer()..onTap = () {
          // Single tapped.
        },
      ),
      
    ],
  ),
)