Menu

Big emoji that move: animating emoji-only messages with Lottie
πŸ“°

Big emoji that move: animating emoji-only messages with Lottie

DEV Community: flutterΒ·Frank MilvusΒ·about 12 hours ago
#2IR4A4CW
#devtoflutter#devto#dev#emoji#animation
Reading 0:00
15s threshold

An animated emoji Flutter feature looks like a one-line change: find the emoji, play a Lottie file. Then you try it and the edge cases arrive. A message that is only emoji already renders as a 48 px glyph in our chat, so the animation has to replace that glyph exactly, not sit beside it. A fire followed by a fire should stay two static glyphs. A heart written with or without a variation selector should still resolve. And a screen reader has to be told what the picture means. This is the story of those constraints, and the small registry that keeps them honest.

The rule: one emoji, exactly

Our chat already had a rule for emoji-only messages: if the trimmed text is nothing but emoji, render it as one large glyph instead of ordinary body text. That rule is deliberately strict. A message with a word in it is text. An emoji caption on an image is a caption. A reply with a reaction is a reply.

The animation slots into that same branch, which is why it stays so contained.…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.