Skip to content

Commit

Permalink
fix: removed hit test behaviour from avatar rail (#197)
Browse files Browse the repository at this point in the history
fix: Removed hit test behavior from avatar rail

feat: Added mouse region to avatar for give click pointer
  • Loading branch information
DE7924 authored Nov 4, 2024
1 parent 08382f6 commit 37b0f8e
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 35 deletions.
1 change: 0 additions & 1 deletion lib/src/components/avatar_rail/avatar_rail.dart
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ class ZetaAvatarRail extends StatelessWidget {
children: [
SingleChildScrollView(
scrollDirection: Axis.horizontal,
hitTestBehavior: HitTestBehavior.translucent,
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expand Down
71 changes: 37 additions & 34 deletions lib/src/components/avatars/avatar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -256,41 +256,44 @@ class ZetaAvatar extends ZetaStatelessWidget {
children: [
Stack(
children: [
GestureDetector(
onTap: onTap,
child: Container(
width: pSize,
height: pSize,
decoration: BoxDecoration(
border: borderColor != null ? Border.all(color: borderColor!, width: 0) : null,
borderRadius: Zeta.of(context).radius.full,
color:
backgroundColor ?? (_showPlaceholder ? zetaColors.surfacePrimary : zetaColors.cool.shade20),
),
child: borderColor != null
? Container(
width: pSize,
height: pSize,
decoration: BoxDecoration(
color: backgroundColor ?? zetaColors.surfaceHover,
border: Border.all(color: borderColor!, width: borderSize(context)),
borderRadius: Zeta.of(context).radius.full,
),
child: ClipRRect(
borderRadius: Zeta.of(context).radius.full,
child: innerContent,
),
)
: DecoratedBox(
decoration: BoxDecoration(
borderRadius: Zeta.of(context).radius.full,
color: backgroundColor ?? zetaColors.surfaceHover,
),
child: ClipRRect(
borderRadius: Zeta.of(context).radius.full,
child: innerContent,
MouseRegion(
cursor: onTap != null ? SystemMouseCursors.click : SystemMouseCursors.basic,
child: GestureDetector(
onTap: onTap,
child: Container(
width: pSize,
height: pSize,
decoration: BoxDecoration(
border: borderColor != null ? Border.all(color: borderColor!, width: 0) : null,
borderRadius: Zeta.of(context).radius.full,
color: backgroundColor ??
(_showPlaceholder ? zetaColors.surfacePrimary : zetaColors.cool.shade20),
),
child: borderColor != null
? Container(
width: pSize,
height: pSize,
decoration: BoxDecoration(
color: backgroundColor ?? zetaColors.surfaceHover,
border: Border.all(color: borderColor!, width: borderSize(context)),
borderRadius: Zeta.of(context).radius.full,
),
child: ClipRRect(
borderRadius: Zeta.of(context).radius.full,
child: innerContent,
),
)
: DecoratedBox(
decoration: BoxDecoration(
borderRadius: Zeta.of(context).radius.full,
color: backgroundColor ?? zetaColors.surfaceHover,
),
child: ClipRRect(
borderRadius: Zeta.of(context).radius.full,
child: innerContent,
),
),
),
),
),
),
if (upperBadge != null)
Expand Down

0 comments on commit 37b0f8e

Please sign in to comment.