fix mobile issues with popover

This commit is contained in:
Henry Hiles 2026-04-01 22:36:03 -04:00
commit a562d043a8
Signed by: Henry-Hiles
SSH key fingerprint: SHA256:VKQUdS31Q90KvX7EkKMHMBpUspcmItAh86a+v7PGiIs

View file

@ -13,79 +13,77 @@ class UserPopover extends ConsumerWidget {
Widget build(BuildContext context, WidgetRef ref) { Widget build(BuildContext context, WidgetRef ref) {
final theme = Theme.of(context); final theme = Theme.of(context);
final textTheme = theme.textTheme; final textTheme = theme.textTheme;
return IntrinsicWidth( return Column(
child: Column( spacing: 16,
spacing: 16, crossAxisAlignment: CrossAxisAlignment.stretch,
crossAxisAlignment: CrossAxisAlignment.stretch, children: [
children: [ Wrap(
Row( alignment: WrapAlignment.center,
spacing: 16, spacing: 16,
mainAxisSize: MainAxisSize.min, runSpacing: 8,
children: [ children: [
AvatarOrHash(member.avatarUrl, member.displayName, height: 80), AvatarOrHash(member.avatarUrl, member.displayName, height: 80),
Expanded( Column(
child: Column( crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, children: [
children: [ SelectableText(
SelectableText( member.displayName,
member.displayName, style: textTheme.headlineSmall,
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( Wrap(
loading: SizedBox.shrink, spacing: 8,
data: (profile) => Row( runSpacing: 8,
spacing: 4, children: [
children: [ FilledButton.icon(onPressed: null, label: Text("Message")),
for (final pronoun in profile.pronouns.where( FilledButton.icon(
(pronoun) => pronoun.language == "en", onPressed: null,
)) label: Text("Kick"),
Chip(label: Text(pronoun.summary)), style: ButtonStyle(
if (profile.timezone != null) backgroundColor: WidgetStatePropertyAll(
Chip(label: Text(profile.timezone!)), theme.colorScheme.error,
], ),
), foregroundColor: WidgetStatePropertyAll(
), theme.colorScheme.onError,
],
), ),
), ),
], ),
), ElevatedButton.icon(
Row( onPressed: null,
spacing: 8, label: Text("Ban"),
children: [ style: ButtonStyle(
FilledButton.icon(onPressed: null, label: Text("Message")), backgroundColor: WidgetStatePropertyAll(
FilledButton.icon( theme.colorScheme.errorContainer,
onPressed: null, ),
label: Text("Kick"), foregroundColor: WidgetStatePropertyAll(
style: ButtonStyle( theme.colorScheme.onErrorContainer,
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,
),
),
),
].map((e) => Expanded(child: e)).toList(),
),
],
),
); );
} }
} }