Skip to content

Commit 848a978

Browse files
committed
user status [nfc]: Pull Padding outside the emojiDisplay switch
1 parent d65be4d commit 848a978

File tree

1 file changed

+16
-19
lines changed

1 file changed

+16
-19
lines changed

lib/widgets/user.dart

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -359,25 +359,22 @@ class UserStatusEmoji extends StatelessWidget {
359359
// Web doesn't seem to respect the emojiset user settings for user status.
360360
// .resolve(store.userSettings)
361361
;
362-
return switch (emojiDisplay) {
363-
UnicodeEmojiDisplay() => Padding(
364-
padding: padding,
365-
child: UnicodeEmojiWidget(size: size, emojiDisplay: emojiDisplay)),
366-
ImageEmojiDisplay() => Padding(
367-
padding: padding,
368-
child: ImageEmojiWidget(
369-
size: size,
370-
emojiDisplay: emojiDisplay,
371-
neverAnimate: neverAnimate,
372-
// If image emoji fails to load, show nothing.
373-
errorBuilder: (_, _, _) => placeholder)),
374-
// The user-status feature doesn't support a :text_emoji:-style display.
375-
// Also, if an image emoji's URL string doesn't parse, it'll fall back to
376-
// a :text_emoji:-style display. We show nothing for this case.
377-
TextEmojiDisplay() => Padding(
378-
padding: padding,
379-
child: placeholder),
380-
};
362+
363+
return Padding(
364+
padding: padding,
365+
child: switch (emojiDisplay) {
366+
UnicodeEmojiDisplay() => UnicodeEmojiWidget(size: size, emojiDisplay: emojiDisplay),
367+
ImageEmojiDisplay() => ImageEmojiWidget(
368+
size: size,
369+
emojiDisplay: emojiDisplay,
370+
neverAnimate: neverAnimate,
371+
// If image emoji fails to load, show nothing.
372+
errorBuilder: (_, _, _) => placeholder),
373+
// The user-status feature doesn't support a :text_emoji:-style display.
374+
// Also, if an image emoji's URL string doesn't parse, it'll fall back to
375+
// a :text_emoji:-style display. We show nothing for this case.
376+
TextEmojiDisplay() => placeholder,
377+
});
381378
}
382379
}
383380

0 commit comments

Comments
 (0)