Refactor dialog stuff

This commit is contained in:
Henry Hiles 2026-04-04 18:26:19 -04:00
commit a8383951ba
Signed by: Henry-Hiles
SSH key fingerprint: SHA256:VKQUdS31Q90KvX7EkKMHMBpUspcmItAh86a+v7PGiIs
6 changed files with 83 additions and 90 deletions

View file

@ -10,11 +10,9 @@ class MentionChip extends ConsumerWidget {
@override
Widget build(BuildContext context, WidgetRef ref) {
final mention = label.mention;
final membership =
mention?.startsWith("@") == true || label.startsWith("@") == true
final membership = label.mention.startsWith("@") == true
? ref
.watch(UserController.provider(mention ?? label))
.watch(UserController.provider(label.mention))
.whenOrNull(data: (data) => data)
: null;
@ -31,8 +29,7 @@ class MentionChip extends ConsumerWidget {
child: Chip(
label: Text(
(membership == null ? null : "@${membership.displayName}") ??
mention ??
label,
label.mention,
style: TextStyle(
fontWeight: FontWeight.bold,
color: Theme.of(context).colorScheme.onPrimary,