Closed franvera closed 3 years ago
That's definitely a possibility, though this will probably only be helpful for a small subset of users, so it would default to a normal RichText with some sort of boolean parameter that makes the text selectable.
I'll look into adding this soon.
@Sub6Resources I agree, a boolean parameter would be great 😁Thank you for all your work!
Any news on this feature? I really need it.
Yep, I need it too
I can implement this. @Sub6Resources Can we have a quick brainstorm/discussion on the tech design? I'd like to know how you'd prefer this to be implemented, especially with the new styling approach. I'm on gitter.im or maybe you can suggest an outline in this thread?
Any news on this feature? I really need it.
Quick update on the SelectableHtml
widget:
@GeertJohan and I have been discussing this feature. We discovered that SelectableText.rich()
requires that all the elements passed into it be TextSpan
s. Unfortunately, flutter_html makes use of WidgetSpan
s in addition to the regular TextSpan
s. I'm working on opening an issue on the main Flutter repository to potentially resolve this, but in the meantime we're looking into allowing Html snippets that don't make use of WidgetSpan
s (i.e. basic inline styled elements without customRender) to be made selectable using the SelectableHtml
.
tl;dr: This is difficult at the moment due to limitations in the Flutter SelectableText
framework, so we're currently looking at building the SelectableHtml
widget for only very simple Html snippets.
Looking forward to it!
I'm looking forward to it too! Really appreciated for this excellent plugin! 💯
I'm not yet implementing this feature because it will have almost no effect for me, I need links to work and found out that clickable elements don't work with SelectableText.rich()
.
See https://github.com/flutter/flutter/issues/43494
Once this has been resolved, I can properly work on a SelectableHtml
that works for simle html.
@GeertJohan @Sub6Resources Looks like this is fixed on flutter/dev. I'm happy to help with the implementation/design if needed.
@nicholasgerard It looks like the issue was closed but I don't see any PRs that mention where the change was made. Do you see something I'm not?
@Sub6Resources Sorry I meant flutter/master, it hasn't landed on dev yet:
how is it going on? flutter now supports selectable text
This feature will take some time to roll to stable. There are also other blocking issues in the flutter framework right now that prevent most HTML from being made selectable and will slow down this feature considerably. Unfortunately it's not as trivial as switching out a RichText() for a SelectableText.rich()
Can this be resolved with the new Flutter Stable?
Any news? Is this feature implemented in v1.0.0?
Still looking forward to it too!
Still waiting also for this
Please be kind and use emoji's or watch this issue instead of posting "Please build this" etc. messages. Those kind of messages are only spamming the thread.
something news about this issue?
We can refer to zefyr
another option: use flutter_markdown + html2md. works for me (html rich messages for chatting)
What's the status right now - is this being actively worked on or do you welcome PRs?
There is no active development in this. PRs are always welcome, especially if they are concise and backward compatible.
To be clear, this is blocked on a Flutter issue https://github.com/flutter/flutter/issues/38474
Thanks, that's some progress! However, should we open a new issue to track feature parity between Html
and SelectableHtml
?
Yes, they can be opened in separate issue. Though as mentioned above https://github.com/flutter/flutter/issues/38474 likely precludes us from fixing said issues.
Any update on this? Would love to use the SelectableHtml widget but it can't even display images
Would it be possible to implement the https://api.flutter.dev/flutter/material/SelectableText-class.html#material.SelectableText.2 widget as a parent?
It appears the constructor
SelectableText.rich
can be useful for this.