It is currently impossible to select text across multiple widgets in Flutter, even with
SelectableText. This is because you can only select the text inside one
SelectableText at a time.
Flutter enables text selection using
SelectableText, otherwise text is not selectable on web. Regarding the difference between regular HTML-based web apps and Flutter-based web apps, the narrative is the following:
You can disable text selection on the Web: […]
The difference is that Flutter makes text not selectable by default. For consistency with Flutter on all other platforms we’d like to keep the current default.
The difference in terms of text selection across multiple “widgets” is that in regular HTML-based apps, you can select text across the whole page. In Flutter, it only works within one
Flutter-based web apps
HTML-based web apps
Considering the Background above, it sounds like the current text selection support is considered equivalent to normal web text selection. However, I think this is not currently the case (also considering #63576 for example).
If you think about the feasibility of making text selectable by default in your app, it is very inconvenient because you need to do multiple things:
- Replace all
- Make sure this is the case only on web, i.e. you want
Textwidgets on mobile instead.
- Live with the fact that text selection across multiple widgets does not work. This is especially cumbersome if you are using many smaller text widgets rather than one big one (which is often the case).
For this feature to be considered supported, solving at least point 3. is necessary. Solving point 1. and 2. also seems like it should be done (although it is technically not necessary) in order to make it less cumbersome to work with.