mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2025-02-25 10:50:40 +01:00
chore: Add border to avatars
This commit is contained in:
parent
fc3ac6c8e7
commit
802ff0fa9d
@ -122,9 +122,7 @@ class StoriesHeader extends StatelessWidget {
|
||||
itemCount: stories.length,
|
||||
itemBuilder: (context, i) {
|
||||
final room = stories[i];
|
||||
return Opacity(
|
||||
opacity: room.hasPosts ? 1 : 0.75,
|
||||
child: FutureBuilder<Profile>(
|
||||
return FutureBuilder<Profile>(
|
||||
future: room.getCreatorProfile(),
|
||||
builder: (context, snapshot) {
|
||||
final userId = room.creatorId;
|
||||
@ -138,6 +136,7 @@ class StoriesHeader extends StatelessWidget {
|
||||
avatarUrl: avatarUrl,
|
||||
userId: userId ?? 'Unknown',
|
||||
),
|
||||
hasPosts: room.hasPosts || room == ownStoryRoom,
|
||||
showEditFab: userId == client.userID,
|
||||
unread: room.membership == Membership.invite ||
|
||||
room.hasNewMessages,
|
||||
@ -145,8 +144,7 @@ class StoriesHeader extends StatelessWidget {
|
||||
onLongPressed: () =>
|
||||
_contextualActions(context, room),
|
||||
);
|
||||
}),
|
||||
);
|
||||
});
|
||||
},
|
||||
),
|
||||
);
|
||||
@ -176,6 +174,7 @@ class _StoryButton extends StatelessWidget {
|
||||
final Profile profile;
|
||||
final bool showEditFab;
|
||||
final bool unread;
|
||||
final bool hasPosts;
|
||||
final void Function() onPressed;
|
||||
final void Function()? onLongPressed;
|
||||
|
||||
@ -183,6 +182,7 @@ class _StoryButton extends StatelessWidget {
|
||||
required this.profile,
|
||||
required this.onPressed,
|
||||
this.showEditFab = false,
|
||||
this.hasPosts = true,
|
||||
this.unread = false,
|
||||
this.onLongPressed,
|
||||
Key? key,
|
||||
@ -196,17 +196,18 @@ class _StoryButton extends StatelessWidget {
|
||||
borderRadius: BorderRadius.circular(7),
|
||||
onTap: onPressed,
|
||||
onLongPress: onLongPressed,
|
||||
child: Opacity(
|
||||
opacity: hasPosts ? 1 : 0.4,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 4),
|
||||
child: Column(
|
||||
children: [
|
||||
const SizedBox(height: 8),
|
||||
Material(
|
||||
elevation: Theme.of(context).appBarTheme.elevation ?? 7,
|
||||
shadowColor: Theme.of(context).appBarTheme.shadowColor,
|
||||
borderRadius: BorderRadius.circular(Avatar.defaultSize),
|
||||
child: Container(
|
||||
padding: const EdgeInsets.all(2),
|
||||
padding: const EdgeInsets.all(3),
|
||||
decoration: BoxDecoration(
|
||||
gradient: unread
|
||||
? const LinearGradient(
|
||||
@ -226,7 +227,8 @@ class _StoryButton extends StatelessWidget {
|
||||
children: [
|
||||
Material(
|
||||
color: Theme.of(context).colorScheme.surface,
|
||||
borderRadius: BorderRadius.circular(Avatar.defaultSize),
|
||||
borderRadius:
|
||||
BorderRadius.circular(Avatar.defaultSize),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(2.0),
|
||||
child: CircleAvatar(
|
||||
@ -281,6 +283,7 @@ class _StoryButton extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -57,13 +57,19 @@ class Avatar extends StatelessWidget {
|
||||
return InkWell(
|
||||
onTap: onTap,
|
||||
borderRadius: borderRadius,
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(color: Theme.of(context).dividerColor),
|
||||
borderRadius: borderRadius,
|
||||
),
|
||||
child: ClipRRect(
|
||||
borderRadius: borderRadius,
|
||||
child: Container(
|
||||
width: size,
|
||||
height: size,
|
||||
color:
|
||||
noPic ? name?.lightColor : Theme.of(context).secondaryHeaderColor,
|
||||
color: noPic
|
||||
? name?.lightColor
|
||||
: Theme.of(context).secondaryHeaderColor,
|
||||
child: noPic
|
||||
? textWidget
|
||||
: CachedNetworkImage(
|
||||
@ -80,6 +86,7 @@ class Avatar extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user