Skip to content

Commit

Permalink
add tooltip to friend card
Browse files Browse the repository at this point in the history
  • Loading branch information
wheremyfiji committed May 23, 2024
1 parent 343c624 commit 536bdee
Showing 1 changed file with 51 additions and 48 deletions.
99 changes: 51 additions & 48 deletions lib/src/presentation/pages/profile/widgets/user_friends.dart
Original file line number Diff line number Diff line change
Expand Up @@ -60,58 +60,61 @@ class UserFriendsWidget extends StatelessWidget {
final isFirstItem = index == 0;
final isLast = index == listLength - 1;

return Container(
margin: EdgeInsets.only(
left: isFirstItem ? 16 : 0,
right: isLast ? 16 : 8,
),
width: 84,
height: 84,
child: isLast && overflow
? Stack(
children: [
CircleAvatar(
radius: 42,
child: Text(
'+${friends.length - c}',
return Tooltip(
message: friend.nickname,
child: Container(
margin: EdgeInsets.only(
left: isFirstItem ? 16 : 0,
right: isLast ? 16 : 8,
),
width: 84,
height: 84,
child: isLast && overflow
? Stack(
children: [
CircleAvatar(
radius: 42,
child: Text(
'+${friends.length - c}',
),
),
),
Material(
type: MaterialType.transparency,
clipBehavior: Clip.hardEdge,
borderRadius: BorderRadius.circular(42),
child: InkWell(
onTap: () => UserFriendsBottomSheet.show(
context,
friends: friends,
Material(
type: MaterialType.transparency,
clipBehavior: Clip.hardEdge,
borderRadius: BorderRadius.circular(42),
child: InkWell(
onTap: () => UserFriendsBottomSheet.show(
context,
friends: friends,
),
),
),
),
],
)
: Stack(
children: [
CachedCircleImage(
friend.image?.x160 ?? friend.avatar ?? '',
radius: 42,
clipBehavior: Clip.antiAlias,
),
Material(
type: MaterialType.transparency,
clipBehavior: Clip.hardEdge,
borderRadius: BorderRadius.circular(42),
child: InkWell(
onTap: friend.id.toString() ==
SecureStorageService.instance.userId
? null
: () => context.push(
'/profile/${friend.id!}',
extra: friend,
),
],
)
: Stack(
children: [
CachedCircleImage(
friend.image?.x160 ?? friend.avatar ?? '',
radius: 42,
clipBehavior: Clip.antiAlias,
),
),
],
),
Material(
type: MaterialType.transparency,
clipBehavior: Clip.hardEdge,
borderRadius: BorderRadius.circular(42),
child: InkWell(
onTap: friend.id.toString() ==
SecureStorageService.instance.userId
? null
: () => context.push(
'/profile/${friend.id!}',
extra: friend,
),
),
),
],
),
),
);
},
),
Expand Down

0 comments on commit 536bdee

Please sign in to comment.