jonataslaw/readmore

Error when collapsing on an emoji

Closed this issue · 3 comments

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

This error occurs only when a preDataText param is specified

I guess this is the problem

dart-lang/sdk#35798

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

Can you please upload minimum reproducible code?