Last active
November 8, 2023 23:23
-
-
Save iapicca/a910397962d1bd9ea3f01afa85b3d2b4 to your computer and use it in GitHub Desktop.
TapGestureRecognizer + SelectableText conflict
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/gestures.dart'; | |
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(MaterialApp(home: MyHome()),); | |
} | |
class MyHome extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) => Scaffold( | |
body: Center (child: | |
SelectableText.rich( | |
TextSpan( | |
children:[ | |
TextSpan( | |
text: 'Some text', | |
recognizer: TapGestureRecognizer() | |
..onTap = ()=>print('tapped on textspan')) | |
]) | |
))); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you. This SelectableText solve my problem!