avatarWithIndicator method
dynamic
avatarWithIndicator( - dynamic context,
- dynamic ref
)
Implementation
Widget avatarWithIndicator(BuildContext context, WidgetRef ref) {
final unreadCounters =
ref.watch(unreadCountersProvider(roomId)).valueOrNull;
final child = RoomAvatar(roomId: roomId, showParents: showParents);
if (unreadCounters == null) {
return child;
}
if (unreadCounters.$1 > 0) {
return Badge(
backgroundColor: Theme.of(context).colorScheme.badgeImportant,
child: child,
);
} else if (unreadCounters.$2 > 0) {
return Badge(
backgroundColor: Theme.of(context).colorScheme.badgeUrgent,
child: child,
);
} else if (unreadCounters.$3 > 0) {
return Badge(
backgroundColor: Theme.of(context).colorScheme.badgeUnread,
child: child,
);
}
// nothing urgent enough for us to indicate anything
return child;
}