Reputation: 33
I'm pretty new to flutter and need to full fill one use case: I have one text widget. Example: Hello there, Good morning. In this text widget, when user long presses on any word say "Good", how to detect those?
I need to log into console that "user selected "Good" from this text".
How to do that in flutter text widget?
Upvotes: 2
Views: 1851
Reputation: 17108
You need to use SelectableText()
widget
Container(
child: SelectableText(
"Hello good morning"
)
),
Upvotes: 1