sshadkany / HeroText

Hero Effect for common words of two Text (Flutter)
https://pub.dev/packages/hero_text
MIT License
8 stars 0 forks source link

How to manage text in limited space ? #2

Open pbouttier opened 2 years ago

pbouttier commented 2 years ago

Hi,

This package is a good idea, but how can we manage a text with limited space, with overflow and ellipsis for example ?

I've tried to tweaks your code and force somes max lines, but if the source can show more than the destination, some part of the text is not in the hero animation.

I've done something like this in _calculateBoundForTexts

if (sum > maxWidth) { nbLines++; if(maxLines != null && nbLines == maxLines) break; .... }

Thanks

sshadkany commented 2 years ago

Hi , Thank you for using this Package, I will work on this feature.