Closed zikajk closed 1 year ago
In general you can select the text. Can you be more specific about what or where you're having trouble?
That is interesting!
I am testing the app in browser and simulator and I am not able to select anything.
I have the same experience with web pages created by Flutter. I've always assumed this is normal behavior because it's not HTML, it's a graphical output that doesn't use HTML.
I have the same experience with web pages created by Flutter. I've always assumed this is normal behavior because it's not HTML, it's a graphical output that doesn't use HTML.
Once I use SelectableText class, then I can select the text (tested in one of buttons on the left side).
Oops.
The screenshot I showed above was from Orgro, and while I remembered correctly that Flutter had changed something about how selection works such that SelectableText
is not needed, I forgot the details of it.
In Orgro I wrap the relevant widget in SelectionArea
. That seems to be sufficient to allow selection inside the Org document.
I did experiment with using SelectableText
in org_flutter in the past, but
OrgText
widget, you can use Org markup to easily create a rich Text
equivalent, which in the general case should not be selectable by default.Great, I didn't know about SelectionArea. It fullfills all my needs. Thank you for the info 🙏
I've updated the readme to mention SelectionArea
. I don't want to make any of org_flutter's widgets selectable by default per above, so I'll close this.
@amake Can you select source-blocks in Orgro?
SelectionArea
seems to have no effect.
And to add, really nice work, thank you for this!
You can select source blocks but only if they don't have syntax highlighting applied (no language specified, or the language is not supported by flutter_highlight).
I haven't looked into why selection doesn't work with that package, but I do note that it seems abandoned and other, newer packages are available, so I am looking at moving to one of them.
It looks like the reason is because flutter_highlight uses a new RichText
widget:
https://github.com/git-touch/highlight.dart/blob/8c08291d18d1e3fdab8564cc3f09726e262e555d/flutter_highlight/lib/flutter_highlight.dart#L93
Apparently you can make a RichText
participate in the surrounding selection context relatively easily, but it requires a change to their library:
https://api.flutter.dev/flutter/widgets/RichText-class.html#selections
I have opened a fix for the issue with flutter_highlighting: https://github.com/akvelon/dart-highlighting/pull/71
Hi! Is there any reason why the text can not be selected (SelectableText class)?