Flutter_html: Use SelectableText - Selectable content

Created on 2 Oct 2019  路  23Comments  路  Source: Sub6Resources/flutter_html

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.

enhancement medium-priority

Most helpful comment

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.

All 23 comments

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 TextSpans. Unfortunately, flutter_html makes use of WidgetSpans in addition to the regular TextSpans. 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 WidgetSpans (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:

https://github.com/flutter/flutter/pull/54479

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)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

AbdoXLabs picture AbdoXLabs  路  5Comments

freddoOswaldo picture freddoOswaldo  路  4Comments

a-href picture a-href  路  4Comments

DrobyshevAlex picture DrobyshevAlex  路  3Comments

assurancetourix picture assurancetourix  路  3Comments