flutter_html icon indicating copy to clipboard operation
flutter_html copied to clipboard

[Investigate] Remove SelectableText in favor of SelectionArea?

Open erickok opened this issue 3 years ago • 3 comments

We should investigate if we can simplify our support for selectable text by removing the usage of SelectableText (which has limitations and behaviour differences) in favor of simply wrapping (even even just recommending) ~~SelectableArea~~ SelectionArea, introduced in Flutter 3.3.

Of course the text selection needs to be as least as good (in behaviour and features) as what we have right now. It could simplify our code though and remove the need to document limitations when using SelectableHtml.

Additional context https://api.flutter.dev/flutter/material/SelectionArea-class.html for the official doc.

erickok avatar Sep 06 '22 22:09 erickok

A very quick try, wrapping the example app in SelectableArea and building to web with canvaskit, worked really well. Even table inside tables was selecting how you'd intuitively expect.

erickok avatar Sep 06 '22 22:09 erickok

That API definitely looks neat. I'll give it a try myself later today! I think if we can remove the burden of Selection logic from our library as much as possible, that would be best.

Sub6Resources avatar Sep 07 '22 19:09 Sub6Resources

I've tried it briefly and it looks like it gets the job done :)

btw it is SelectionArea, not SelectableArea (the api document link is correct though)

asmith20002 avatar Sep 15 '22 19:09 asmith20002

3.0.0 is not supported with SelectionArea . Caused by fix: Fix issue with font scaling introduced in 3.0.0-alpha.6 (#1173).

windows7lake avatar Nov 28 '22 02:11 windows7lake