dash_chat icon indicating copy to clipboard operation
dash_chat copied to clipboard

1.1.16 cannot show emojis

Open edukun opened this issue 3 years ago • 4 comments

1.1.16 break emojis. If you try to load a message with an emoji, you get this error:

invalid argument(s) string is not well-formed utf-16

Rolling back to 1.1.15 fixes the problem. With this configuration:

dependencies: dash_chat: 1.1.15 dependency_overrides: intl: ^0.17.0 uuid: ^3.0.0

edukun avatar Jun 03 '21 12:06 edukun

Any fix here ? Really need that 1.1.16 cause working with both dash_chat and flutter_parsed_text 2.2, 1.1.15 need flutter_parsed_text 1.1 which not work with my current code.

oneshoot41 avatar Jun 11 '21 00:06 oneshoot41

@fayeed Any updates on this?

Johan-glitch1412 avatar Jul 05 '21 08:07 Johan-glitch1412

Bump. I was planning on making my own chat interface anyways but having one that works in the meantime would be nice. @Johan-glitch1412 the fix you mentioned doesn't work for me.

Rexios80 avatar Jul 13 '21 02:07 Rexios80

Took me a while to figure this out. Use a custom text builder, something as below:

...
messageTextBuilder: buildTextMessage,
...
Widget buildTextMessage(String? text, [ChatMessage? message]) {
    bool isUser = message!.user.uid == vm.user.uid;
    return ParsedText(
      parse: [],
      regexOptions: RegexOptions(unicode: true),
      text: message.text!,
      style: TextStyle(
        color: message.user.color ??
            (isUser ? Colors.white70 : Colors.black87),
      ),
    );
}

The default builder took regexOptions with unicode = false causing the error.

giaunguyen2176 avatar Aug 27 '21 16:08 giaunguyen2176