Skip to content

Commit

Permalink
Fixes position issues for click event
Browse files Browse the repository at this point in the history
  • Loading branch information
kumarpalsinh25 committed Aug 21, 2024
1 parent 4617d3b commit fb7d02a
Showing 1 changed file with 23 additions and 20 deletions.
43 changes: 23 additions & 20 deletions lib/src/acter_avatar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -254,39 +254,42 @@ class _ActerAvatar extends State<ActerAvatar> {
List<Widget> children = badges
.getRange(0, thresholdCount)
.map(
(badge) => ActerAvatar(
options: AvatarOptions(badge, size: size),
(badge) => GestureDetector(
onTap: options.onTapParentBadges,
child: ActerAvatar(
options: AvatarOptions(badge, size: size),
),
),
)
.cast<Widget>()
.toList();

if (badgesLength > 3) {
children.add(Container(
width: 10,
height: 10,
alignment: Alignment.center,
decoration: const BoxDecoration(
color: Colors.green,
shape: BoxShape.circle,
),
child: Text(
'+${badgesLength - 3}',
style: const TextStyle(fontSize: 8),
textScaler: TextScaler.linear(0.7),
children.add(GestureDetector(
onTap: options.onTapParentBadges,
child: Container(
width: 10,
height: 10,
alignment: Alignment.center,
decoration: const BoxDecoration(
color: Colors.green,
shape: BoxShape.circle,
),
child: Text(
'+${badgesLength - 3}',
style: const TextStyle(fontSize: 8),
textScaler: TextScaler.linear(0.7),
),
),
));
}

return Positioned(
bottom: -badgeOverflow,
right: -badgeOverflow,
child: GestureDetector(
onTap: options.onTapParentBadges,
child: Wrap(
spacing: -5,
children: children,
),
child: Wrap(
spacing: -5,
children: children,
),
);
}
Expand Down

0 comments on commit fb7d02a

Please sign in to comment.