Skip to content

Commit

Permalink
feat: added mouse region to give click pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
DE7924 committed Nov 4, 2024
1 parent ef946c3 commit 55c5e91
Showing 1 changed file with 37 additions and 34 deletions.
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 55c5e91

Please sign in to comment.