desconexo / highlight_text

A flutter plugin to highlight words from a text
MIT License
30 stars 22 forks source link

Selectable text #22

Closed Ashish-Raturi closed 2 years ago

Ashish-Raturi commented 2 years ago

how to make it selectable text

fleeser commented 2 years ago

@Ashish-Raturi A callback can be set by just passing it to the onPressed parameter. If you would like to make the text visibly selectable to copy etc. you can just wrap your Text widget inside a SelectableText widget.

desconexo commented 2 years ago

I'll close it due to lack of information

hagaygo commented 1 year ago

I am also trying to create a selectable text with highlighting.

Without highlighting i can simply use SelectableWidget (https://api.flutter.dev/flutter/material/SelectableText-class.html) which allows the user to mark the text and copy it to clipboard.

With your plugin i can manage the Highlighting but loosing the select text feature available on SelectableWidget.

From the answer given by @fleeser it seems there is an option to assign a text widget instead of text (only string parameter is available), If it is possible , an example will be much appreciated.