chore: Follow up spaces design

This commit is contained in:
Krille 2024-07-15 13:47:01 +02:00
commit 942970e049
No known key found for this signature in database
GPG key ID: E067ECD60F1A0652

View file

@ -108,96 +108,72 @@ class ChatListItem extends StatelessWidget {
visualDensity: const VisualDensity(vertical: -0.5), visualDensity: const VisualDensity(vertical: -0.5),
contentPadding: const EdgeInsets.symmetric(horizontal: 8), contentPadding: const EdgeInsets.symmetric(horizontal: 8),
onLongPress: onLongPress, onLongPress: onLongPress,
leading: Stack( leading: HoverBuilder(
clipBehavior: Clip.none, builder: (context, hovered) => AnimatedScale(
children: [ duration: FluffyThemes.animationDuration,
HoverBuilder( curve: FluffyThemes.animationCurve,
builder: (context, hovered) => AnimatedScale( scale: hovered ? 1.1 : 1.0,
duration: FluffyThemes.animationDuration, child: SizedBox(
curve: FluffyThemes.animationCurve, width: Avatar.defaultSize,
scale: hovered ? 1.1 : 1.0, height: Avatar.defaultSize,
child: SizedBox( child: Stack(
width: Avatar.defaultSize, children: [
height: Avatar.defaultSize, if (space != null)
child: Stack( Positioned(
children: [ top: 0,
if (space != null) left: 0,
Positioned( child: Avatar(
top: 0, border: BorderSide(
left: 0, width: 2,
child: Avatar( color: backgroundColor ??
border: BorderSide( Theme.of(context).colorScheme.surface,
),
borderRadius: BorderRadius.circular(
AppConfig.borderRadius / 4,
),
mxContent: space.avatar,
size: Avatar.defaultSize * 0.75,
name: space.getLocalizedDisplayname(),
onTap: onLongPress,
),
),
Positioned(
bottom: 0,
right: 0,
child: Avatar(
border: space == null
? room.isSpace
? BorderSide(
width: 0,
color: Theme.of(context)
.colorScheme
.outline,
)
: null
: BorderSide(
width: 2, width: 2,
color: backgroundColor ?? color: backgroundColor ??
Theme.of(context).colorScheme.surface, Theme.of(context).colorScheme.surface,
), ),
borderRadius: BorderRadius.circular( borderRadius: room.isSpace
? BorderRadius.circular(
AppConfig.borderRadius / 4, AppConfig.borderRadius / 4,
), )
mxContent: space.avatar, : null,
size: Avatar.defaultSize * 0.75, mxContent: room.avatar,
name: space.getLocalizedDisplayname(), size: space != null
onTap: onLongPress, ? Avatar.defaultSize * 0.75
), : Avatar.defaultSize,
), name: displayname,
Positioned( presenceUserId: directChatMatrixId,
bottom: 0, presenceBackgroundColor: backgroundColor,
right: 0, onTap: onLongPress,
child: Avatar( ),
border: space == null
? room.isSpace
? BorderSide(
width: 0,
color: Theme.of(context)
.colorScheme
.outline,
)
: null
: BorderSide(
width: 2,
color: backgroundColor ??
Theme.of(context)
.colorScheme
.surface,
),
borderRadius: room.isSpace
? BorderRadius.circular(
AppConfig.borderRadius / 4,
)
: null,
mxContent: room.avatar,
size: space != null
? Avatar.defaultSize * 0.75
: Avatar.defaultSize,
name: displayname,
presenceUserId: directChatMatrixId,
presenceBackgroundColor: backgroundColor,
onTap: onLongPress,
),
),
],
), ),
), ],
), ),
), ),
Positioned( ),
bottom: -2,
right: -2,
child: AnimatedScale(
duration: FluffyThemes.animationDuration,
curve: FluffyThemes.animationCurve,
scale: (hovered) ? 1.0 : 0.0,
child: Material(
color: backgroundColor,
borderRadius: BorderRadius.circular(16),
child: const Icon(
Icons.check_circle_outlined,
size: 18,
),
),
),
),
],
), ),
title: Row( title: Row(
children: <Widget>[ children: <Widget>[