jonataslaw / readmore

A Flutter plugin than allow expand and collapse text dynamically
MIT License
257 stars 79 forks source link

Error when collapsing on an emoji #39

Closed LeGoffMael closed 6 months ago

LeGoffMael commented 2 years ago

When the last character of the line that is collapsed is an emoji, an error is thrown :

════════ Exception caught by painting library ══════════════════════════════════
The following ArgumentError was thrown while building a TextSpan:
Invalid argument(s): string is not well-formed UTF-16
LeGoffMael commented 1 year ago

This error occurs only when a preDataText param is specified

neo1125 commented 1 year ago

I guess this is the problem

https://github.com/dart-lang/sdk/issues/35798

widget.data.substring(0, endIndex) => String.fromCharCodes(widget.data.runes, 0, endIndex)

Faiizii commented 1 year ago

Can you please upload minimum reproducible code?