File tree Expand file tree Collapse file tree 2 files changed +22
-10
lines changed Expand file tree Collapse file tree 2 files changed +22
-10
lines changed Original file line number Diff line number Diff line change @@ -370,13 +370,19 @@ class _EmojiAutocompleteItem extends StatelessWidget {
370370 final designVariables = DesignVariables .of (context);
371371 final candidate = option.candidate;
372372
373- // TODO deduplicate this logic with [EmojiPickerListEntry]
374373 final emojiDisplay = candidate.emojiDisplay.resolve (store.userSettings);
375374 final Widget ? glyph = switch (emojiDisplay) {
376- ImageEmojiDisplay () =>
377- ImageEmojiWidget (size: _size, emojiDisplay: emojiDisplay),
378- UnicodeEmojiDisplay () =>
379- UnicodeEmojiWidget (size: _size, emojiDisplay: emojiDisplay),
375+ ImageEmojiDisplay () || UnicodeEmojiDisplay () => EmojiWidget (
376+ emojiDisplay: emojiDisplay,
377+ squareDimension: _size,
378+ imagePlaceholderStyle: EmojiImagePlaceholderStyle .square,
379+ buildCustomTextEmoji: () {
380+ // emojiDisplay is not TextEmojiDisplay,
381+ // and imagePlaceholderStyle is not EmojiImagePlaceholderStyle.text.
382+ assert (false );
383+ return SizedBox .shrink ();
384+ },
385+ ),
380386 TextEmojiDisplay () => null , // The text is already shown separately.
381387 };
382388
Original file line number Diff line number Diff line change @@ -555,13 +555,19 @@ class EmojiPickerListEntry extends StatelessWidget {
555555 final store = PerAccountStoreWidget .of (context);
556556 final designVariables = DesignVariables .of (context);
557557
558- // TODO deduplicate this logic with [_EmojiAutocompleteItem]
559558 final emojiDisplay = emoji.emojiDisplay.resolve (store.userSettings);
560559 final Widget ? glyph = switch (emojiDisplay) {
561- ImageEmojiDisplay () =>
562- ImageEmojiWidget (size: _emojiSize, emojiDisplay: emojiDisplay),
563- UnicodeEmojiDisplay () =>
564- UnicodeEmojiWidget (size: _emojiSize, emojiDisplay: emojiDisplay),
560+ ImageEmojiDisplay () || UnicodeEmojiDisplay () => EmojiWidget (
561+ emojiDisplay: emojiDisplay,
562+ squareDimension: _emojiSize,
563+ imagePlaceholderStyle: EmojiImagePlaceholderStyle .square,
564+ buildCustomTextEmoji: () {
565+ // emojiDisplay is not TextEmojiDisplay,
566+ // and imagePlaceholderStyle is not EmojiImagePlaceholderStyle.text.
567+ assert (false );
568+ return SizedBox .shrink ();
569+ },
570+ ),
565571 TextEmojiDisplay () => null , // The text is already shown separately.
566572 };
567573
You can’t perform that action at this time.
0 commit comments