From 37b0f8e284d0b734a1ca9b3e17fccbbca6c60fa5 Mon Sep 17 00:00:00 2001 From: Daniel Eshkeri Date: Mon, 4 Nov 2024 11:46:52 +0000 Subject: [PATCH] fix: removed hit test behaviour from avatar rail (#197) fix: Removed hit test behavior from avatar rail feat: Added mouse region to avatar for give click pointer --- .../components/avatar_rail/avatar_rail.dart | 1 - lib/src/components/avatars/avatar.dart | 71 ++++++++++--------- 2 files changed, 37 insertions(+), 35 deletions(-) diff --git a/lib/src/components/avatar_rail/avatar_rail.dart b/lib/src/components/avatar_rail/avatar_rail.dart index c57feac4..a9066c93 100644 --- a/lib/src/components/avatar_rail/avatar_rail.dart +++ b/lib/src/components/avatar_rail/avatar_rail.dart @@ -88,7 +88,6 @@ class ZetaAvatarRail extends StatelessWidget { children: [ SingleChildScrollView( scrollDirection: Axis.horizontal, - hitTestBehavior: HitTestBehavior.translucent, child: Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ diff --git a/lib/src/components/avatars/avatar.dart b/lib/src/components/avatars/avatar.dart index 39a1b7eb..79453f2d 100644 --- a/lib/src/components/avatars/avatar.dart +++ b/lib/src/components/avatars/avatar.dart @@ -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)