From a562d043a83e15bc9160cb920517ee63067d55dd Mon Sep 17 00:00:00 2001 From: Henry-Hiles Date: Wed, 1 Apr 2026 22:36:03 -0400 Subject: [PATCH] fix mobile issues with popover --- lib/widgets/chat_page/user_popover.dart | 134 ++++++++++++------------ 1 file changed, 66 insertions(+), 68 deletions(-) diff --git a/lib/widgets/chat_page/user_popover.dart b/lib/widgets/chat_page/user_popover.dart index 9907741..88993ed 100644 --- a/lib/widgets/chat_page/user_popover.dart +++ b/lib/widgets/chat_page/user_popover.dart @@ -13,79 +13,77 @@ class UserPopover extends ConsumerWidget { Widget build(BuildContext context, WidgetRef ref) { final theme = Theme.of(context); final textTheme = theme.textTheme; - return IntrinsicWidth( - child: Column( - spacing: 16, - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - Row( - spacing: 16, - mainAxisSize: MainAxisSize.min, - children: [ - AvatarOrHash(member.avatarUrl, member.displayName, height: 80), - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SelectableText( - member.displayName, - style: textTheme.headlineSmall, + return Column( + spacing: 16, + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + Wrap( + alignment: WrapAlignment.center, + spacing: 16, + runSpacing: 8, + children: [ + AvatarOrHash(member.avatarUrl, member.displayName, height: 80), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SelectableText( + member.displayName, + style: textTheme.headlineSmall, + ), + SelectableText(member.userId, style: textTheme.titleSmall), + SizedBox(height: 4), + ref + .watch(ProfileController.provider(member.userId)) + .betterWhen( + loading: SizedBox.shrink, + data: (profile) => Wrap( + spacing: 4, + children: [ + for (final pronoun in profile.pronouns.where( + (pronoun) => pronoun.language == "en", + )) + Chip(label: Text(pronoun.summary)), + if (profile.timezone != null) + Chip(label: Text(profile.timezone!)), + ], + ), ), - SelectableText(member.userId, style: textTheme.titleSmall), - SizedBox(height: 4), - ref - .watch(ProfileController.provider(member.userId)) - .betterWhen( - loading: SizedBox.shrink, - data: (profile) => Row( - spacing: 4, - children: [ - for (final pronoun in profile.pronouns.where( - (pronoun) => pronoun.language == "en", - )) - Chip(label: Text(pronoun.summary)), - if (profile.timezone != null) - Chip(label: Text(profile.timezone!)), - ], - ), - ), - ], + ], + ), + ], + ), + Wrap( + spacing: 8, + runSpacing: 8, + children: [ + FilledButton.icon(onPressed: null, label: Text("Message")), + FilledButton.icon( + onPressed: null, + label: Text("Kick"), + style: ButtonStyle( + backgroundColor: WidgetStatePropertyAll( + theme.colorScheme.error, + ), + foregroundColor: WidgetStatePropertyAll( + theme.colorScheme.onError, ), ), - ], - ), - Row( - spacing: 8, - children: [ - FilledButton.icon(onPressed: null, label: Text("Message")), - FilledButton.icon( - onPressed: null, - label: Text("Kick"), - style: ButtonStyle( - backgroundColor: WidgetStatePropertyAll( - theme.colorScheme.error, - ), - foregroundColor: WidgetStatePropertyAll( - theme.colorScheme.onError, - ), + ), + ElevatedButton.icon( + onPressed: null, + label: Text("Ban"), + style: ButtonStyle( + backgroundColor: WidgetStatePropertyAll( + theme.colorScheme.errorContainer, + ), + foregroundColor: WidgetStatePropertyAll( + theme.colorScheme.onErrorContainer, ), ), - ElevatedButton.icon( - onPressed: null, - label: Text("Ban"), - style: ButtonStyle( - backgroundColor: WidgetStatePropertyAll( - theme.colorScheme.errorContainer, - ), - foregroundColor: WidgetStatePropertyAll( - theme.colorScheme.onErrorContainer, - ), - ), - ), - ].map((e) => Expanded(child: e)).toList(), - ), - ], - ), + ), + ], + ), + ], ); } }