part of '../neon_spreed.dart'; class SpreedRoomIcon extends StatelessWidget { const SpreedRoomIcon({ required this.roomType, this.roomName, this.backgroundColor, this.foregroundColor, super.key, }) : assert( (roomType != spreed.RoomType.oneToOne && roomType != spreed.RoomType.oneToOneFormer) || roomName != null, 'roomName has to be set when roomType is oneToOne', ); final spreed.RoomType roomType; final String? roomName; final Color? backgroundColor; final Color? foregroundColor; @override Widget build(final BuildContext context) { if (roomType == spreed.RoomType.oneToOne || roomType == spreed.RoomType.oneToOneFormer) { return NeonUserAvatar( username: roomName, account: NeonProvider.of(context).activeAccount.value!, backgroundColor: backgroundColor, foregroundColor: foregroundColor, ); } if (roomType == spreed.RoomType.changelog) { return CircleAvatar( radius: smallIconSize, backgroundColor: backgroundColor ?? Theme.of(context).colorScheme.primary, child: VectorGraphic( width: smallIconSize, height: smallIconSize, colorFilter: ColorFilter.mode(foregroundColor ?? Theme.of(context).colorScheme.onPrimary, BlendMode.srcIn), loader: const AssetBytesLoader( 'assets/app.svg.vec', packageName: 'neon_spreed', ), semanticsLabel: NeonLocalizations.of(context).nextcloudLogo, ), ); } if (roomType == spreed.RoomType.group || roomType == spreed.RoomType.public) { return NeonGroupAvatar( icon: roomType == spreed.RoomType.group ? Icons.group : Icons.public, backgroundColor: backgroundColor, foregroundColor: foregroundColor, ); } throw UnimplementedError('Room type $roomType has no implemented icon'); } }