peaashmeter / rich_typewriter

A widget that makes underlying Text.rich or RichText animate like a typewriter.
MIT License
0 stars 0 forks source link

How to use SelectableText.rich #2

Open mbenci opened 1 month ago

mbenci commented 1 month ago

Is it possible to use Selectable RichText (SelectableText.rich(...) instead of simple RichText? And if so, how?

Thanks

peaashmeter commented 1 month ago

Hi! Unfortunately, SelectableRichText has a quite different implementation deep inside Flutter, so a simple replacement would cause tons of errors and not work properly. Right now, you may consider using SelectionArea, however here are the drawbacks:

Both problems are caused by the approach we animate the text (changing the layout every frame, so every new frame the existing selection is thrown away). As this is a useful and requested feature, I'll try finding a solution later.