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