Tweak avatar for thumbnail view

This commit is contained in:
Neeraj Gupta 2022-12-16 18:39:14 +05:30
parent 08277a3de3
commit fe2228031f
No known key found for this signature in database
GPG key ID: 3C5A1684DC1729E1
4 changed files with 21 additions and 10 deletions

View file

@ -396,6 +396,7 @@ class IncomingCollectionItem extends StatelessWidget {
padding: const EdgeInsets.only(right: 8.0, bottom: 8.0),
child: UserAvatarWidget(
c.collection.owner,
thumbnailView: true,
),
),
),

View file

@ -253,7 +253,10 @@ class EmailItemWidget extends StatelessWidget {
captionedTextWidget: CaptionedTextWidget(
title: collection.getSharees().firstOrNull?.email ?? '',
),
leadingIconWidget: UserAvatarWidget(collection.getSharees().first),
leadingIconWidget: UserAvatarWidget(
collection.getSharees().first,
thumbnailView: true,
),
leadingIconSize: 24,
menuItemColor: getEnteColorScheme(context).fillFaint,
pressedColor: getEnteColorScheme(context).fillFaint,

View file

@ -10,12 +10,14 @@ class UserAvatarWidget extends StatelessWidget {
final User user;
final AvatarType type;
final int currentUserID;
final bool thumbnailView;
const UserAvatarWidget(
this.user, {
super.key,
this.currentUserID = -1,
this.type = AvatarType.mini,
this.thumbnailView = false,
});
@override
@ -36,15 +38,19 @@ class UserAvatarWidget extends StatelessWidget {
return Container(
height: size,
width: size,
padding: const EdgeInsets.all(2),
decoration: BoxDecoration(
shape: BoxShape.circle,
color: decorationColor,
border: Border.all(
color: strokeBaseDark,
width: 1.0,
),
),
padding: thumbnailView
? const EdgeInsets.only(bottom: 1)
: const EdgeInsets.all(2),
decoration: thumbnailView
? null
: BoxDecoration(
shape: BoxShape.circle,
color: decorationColor,
border: Border.all(
color: strokeBaseDark,
width: 1.0,
),
),
child: CircleAvatar(
backgroundColor: decorationColor,
child: Text(

View file

@ -100,6 +100,7 @@ class OwnerAvatarOverlayIcon extends StatelessWidget {
child: UserAvatarWidget(
user,
type: AvatarType.tiny,
thumbnailView: true,
),
),
);