1
0
mirror of https://github.com/immich-app/immich.git synced 2025-08-08 23:07:06 +02:00

feat: album edit (#19936)

This commit is contained in:
Alex
2025-07-15 20:37:44 -05:00
committed by GitHub
parent bcb968e3d1
commit 34620e1e9a
22 changed files with 2271 additions and 102 deletions

View File

@ -14,11 +14,13 @@ class UserCircleAvatar extends ConsumerWidget {
final UserDto user;
double radius;
double size;
bool hasBorder;
UserCircleAvatar({
super.key,
this.radius = 22,
this.size = 44,
this.hasBorder = false,
required this.user,
});
@ -38,25 +40,39 @@ class UserCircleAvatar extends ConsumerWidget {
),
child: Text(user.name[0].toUpperCase()),
);
return CircleAvatar(
backgroundColor: userAvatarColor,
radius: radius,
child: user.profileImagePath == null
? textIcon
: ClipRRect(
borderRadius: const BorderRadius.all(Radius.circular(50)),
child: CachedNetworkImage(
fit: BoxFit.cover,
cacheKey: user.profileImagePath,
width: size,
height: size,
placeholder: (_, __) => Image.memory(kTransparentImage),
imageUrl: profileImageUrl,
httpHeaders: ApiService.getRequestHeaders(),
fadeInDuration: const Duration(milliseconds: 300),
errorWidget: (context, error, stackTrace) => textIcon,
),
),
return Tooltip(
message: user.name,
child: Container(
decoration: BoxDecoration(
shape: BoxShape.circle,
border: hasBorder
? Border.all(
color: Colors.grey[500]!,
width: 1,
)
: null,
),
child: CircleAvatar(
backgroundColor: userAvatarColor,
radius: radius,
child: user.profileImagePath == null
? textIcon
: ClipRRect(
borderRadius: const BorderRadius.all(Radius.circular(50)),
child: CachedNetworkImage(
fit: BoxFit.cover,
cacheKey: user.profileImagePath,
width: size,
height: size,
placeholder: (_, __) => Image.memory(kTransparentImage),
imageUrl: profileImageUrl,
httpHeaders: ApiService.getRequestHeaders(),
fadeInDuration: const Duration(milliseconds: 300),
errorWidget: (context, error, stackTrace) => textIcon,
),
),
),
),
);
}
}