Skip to content

Commit f0fa429

Browse files
committed
user status: When we can't load image emoji, lay out a padded empty square
Instead of laying out - just padding, in the case where the network request failed, and - nothing, in the case where the URL didn't parse.
1 parent bc2e58e commit f0fa429

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lib/widgets/user.dart

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -349,8 +349,8 @@ class UserStatusEmoji extends StatelessWidget {
349349
final store = PerAccountStoreWidget.of(context);
350350
final effectiveEmoji = emoji ?? store.getUserStatus(userId!).emoji;
351351

352-
final placeholder = SizedBox.shrink();
353-
if (effectiveEmoji == null) return placeholder;
352+
final placeholder = SizedBox.square(dimension: size);
353+
if (effectiveEmoji == null) return SizedBox.shrink();
354354

355355
final emojiDisplay = store.emojiDisplayFor(
356356
emojiType: effectiveEmoji.reactionType,
@@ -374,7 +374,9 @@ class UserStatusEmoji extends StatelessWidget {
374374
// The user-status feature doesn't support a :text_emoji:-style display.
375375
// Also, if an image emoji's URL string doesn't parse, it'll fall back to
376376
// a :text_emoji:-style display. We show nothing for this case.
377-
TextEmojiDisplay() => placeholder,
377+
TextEmojiDisplay() => Padding(
378+
padding: padding,
379+
child: placeholder),
378380
};
379381
}
380382
}

0 commit comments

Comments
 (0)