From 8ee3bb194eebabb29f17852681db0b74d9e388f4 Mon Sep 17 00:00:00 2001 From: ggurdin Date: Fri, 23 Jan 2026 13:33:39 -0500 Subject: [PATCH] chore: show shimmer on full activity role indicator --- .../activity_participant_indicator.dart | 93 +++++++++---------- 1 file changed, 45 insertions(+), 48 deletions(-) diff --git a/lib/pangea/activity_sessions/activity_participant_indicator.dart b/lib/pangea/activity_sessions/activity_participant_indicator.dart index cb1d7ce7d..99f7a8ec2 100644 --- a/lib/pangea/activity_sessions/activity_participant_indicator.dart +++ b/lib/pangea/activity_sessions/activity_participant_indicator.dart @@ -2,10 +2,9 @@ import 'package:flutter/material.dart'; import 'package:cached_network_image/cached_network_image.dart'; import 'package:matrix/matrix.dart'; -import 'package:shimmer/shimmer.dart'; -import 'package:fluffychat/config/app_config.dart'; import 'package:fluffychat/l10n/l10n.dart'; +import 'package:fluffychat/pangea/common/widgets/shimmer_background.dart'; import 'package:fluffychat/utils/string_color.dart'; import 'package:fluffychat/widgets/avatar.dart'; import 'package:fluffychat/widgets/hover_builder.dart'; @@ -88,54 +87,52 @@ class ActivityParticipantIndicator extends StatelessWidget { ); return Opacity( opacity: opacity, - child: Container( - padding: padding ?? - const EdgeInsets.symmetric( - vertical: 4.0, - horizontal: 8.0, - ), - decoration: BoxDecoration( - borderRadius: borderRadius ?? BorderRadius.circular(8.0), - color: (hovered || selected) && selectable - ? theme.colorScheme.surfaceContainerHighest - : theme.colorScheme.surface.withAlpha(130), - ), - height: 125.0, - constraints: const BoxConstraints(maxWidth: 100.0), - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - shimmer && !selected - ? Shimmer.fromColors( - baseColor: AppConfig.gold.withAlpha(20), - highlightColor: AppConfig.gold.withAlpha(50), - child: avatar, - ) - : avatar, - Text( - name, - style: const TextStyle( - fontSize: 12.0, + child: ShimmerBackground( + enabled: shimmer, + child: Container( + padding: padding ?? + const EdgeInsets.symmetric( + vertical: 4.0, + horizontal: 8.0, ), - maxLines: 2, - overflow: TextOverflow.ellipsis, - textAlign: TextAlign.center, - ), - Text( - userId?.localpart ?? L10n.of(context).openRoleLabel, - style: TextStyle( - fontSize: 12.0, - color: (Theme.of(context).brightness == - Brightness.light - ? (userId?.localpart?.darkColor ?? name.darkColor) - : (userId?.localpart?.lightColorText ?? - name.lightColorText)), + decoration: BoxDecoration( + borderRadius: borderRadius ?? BorderRadius.circular(8.0), + color: (hovered || selected) && selectable + ? theme.colorScheme.surfaceContainerHighest + : theme.colorScheme.surface.withAlpha(130), + ), + height: 125.0, + constraints: const BoxConstraints(maxWidth: 100.0), + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + avatar, + Text( + name, + style: const TextStyle( + fontSize: 12.0, + ), + maxLines: 2, + overflow: TextOverflow.ellipsis, + textAlign: TextAlign.center, ), - textAlign: TextAlign.center, - maxLines: 1, - overflow: TextOverflow.ellipsis, - ), - ], + Text( + userId?.localpart ?? L10n.of(context).openRoleLabel, + style: TextStyle( + fontSize: 12.0, + color: (Theme.of(context).brightness == + Brightness.light + ? (userId?.localpart?.darkColor ?? + name.darkColor) + : (userId?.localpart?.lightColorText ?? + name.lightColorText)), + ), + textAlign: TextAlign.center, + maxLines: 1, + overflow: TextOverflow.ellipsis, + ), + ], + ), ), ), );