Skip to content

Commit

Permalink
fix: 🐛Fixed cursor not changing to click mode issue (#503) (#504)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sahil-Simform authored Feb 26, 2025
1 parent ea99366 commit 817e005
Show file tree
Hide file tree
Showing 4 changed files with 175 additions and 152 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
## [4.1.0] - (UnRelease)
- Feature [#500](https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/issues/500) -
Added `onDismiss` callback in `ShowCaseWidget` which will trigger whenever `onDismiss` method is
called
called.
- Fixed [#503](https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/issues/503) - Cursor
not changing to click mode when it is hovering over the clickable widgets provided by this
package.

## [4.0.1]
- Fixed [#493](https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/issues/493) - ShowCase.withWidget not showing issue
Expand Down
10 changes: 8 additions & 2 deletions lib/src/showcase.dart
Original file line number Diff line number Diff line change
Expand Up @@ -807,7 +807,10 @@ class _ShowcaseState extends State<Showcase> {
showArrow: widget.showArrow,
contentHeight: widget.height,
contentWidth: widget.width,
onTooltipTap: _getOnTooltipTap,
onTooltipTap:
widget.disposeOnTap == true || widget.onToolTipClick != null
? _getOnTooltipTap
: null,
tooltipPadding: widget.tooltipPadding,
disableMovingAnimation: widget.disableMovingAnimation ??
showCaseWidgetState.disableMovingAnimation,
Expand Down Expand Up @@ -908,7 +911,10 @@ class _TargetWidget extends StatelessWidget {
? IgnorePointer(
child: targetWidgetContent(),
)
: targetWidgetContent(),
: MouseRegion(
cursor: SystemMouseCursors.click,
child: targetWidgetContent(),
),
);
}

Expand Down
59 changes: 31 additions & 28 deletions lib/src/tooltip_action_button_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,35 +21,38 @@ class TooltipActionButtonWidget extends StatelessWidget {
final theme = Theme.of(context);

return config.button ??
GestureDetector(
onTap: handleOnTap,
child: Container(
padding: config.padding,
decoration: BoxDecoration(
color: config.backgroundColor ?? theme.primaryColor,
borderRadius: config.borderRadius,
border: config.border,
),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
if (config.leadIcon != null)
Padding(
padding: config.leadIcon?.padding ??
const EdgeInsets.only(right: 5),
child: config.leadIcon?.icon,
),
Text(
config.name ?? config.type?.actionName ?? '',
style: config.textStyle,
),
if (config.tailIcon != null)
Padding(
padding: config.tailIcon?.padding ??
const EdgeInsets.only(left: 5),
child: config.tailIcon?.icon,
MouseRegion(
cursor: SystemMouseCursors.click,
child: GestureDetector(
onTap: handleOnTap,
child: Container(
padding: config.padding,
decoration: BoxDecoration(
color: config.backgroundColor ?? theme.primaryColor,
borderRadius: config.borderRadius,
border: config.border,
),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
if (config.leadIcon != null)
Padding(
padding: config.leadIcon?.padding ??
const EdgeInsets.only(right: 5),
child: config.leadIcon?.icon,
),
Text(
config.name ?? config.type?.actionName ?? '',
style: config.textStyle,
),
],
if (config.tailIcon != null)
Padding(
padding: config.tailIcon?.padding ??
const EdgeInsets.only(left: 5),
child: config.tailIcon?.icon,
),
],
),
),
),
);
Expand Down
Loading

0 comments on commit 817e005

Please sign in to comment.