Skip to content

Commit

Permalink
fix: 🐛Fixed cursor not changing to click mode issue (#503)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sahil-Simform committed Feb 26, 2025
1 parent ea99366 commit f3f47c0
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 32 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
- Feature [#500](https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/issues/500) -
Added `onDismiss` callback in `ShowCaseWidget` which will trigger whenever `onDismiss` method is
called
- Fixed [#503](https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/issues/503) - Cursor
not changing to click mode when it is hovering over the default action widgets.

## [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
4 changes: 2 additions & 2 deletions lib/src/tooltip_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ class _ToolTipWidgetState extends State<ToolTipWidget>
child: ClipRRect(
borderRadius: widget.tooltipBorderRadius ??
BorderRadius.circular(8.0),
child: GestureDetector(
child: InkWell(
onTap: widget.onTooltipTap,
child: Container(
width: tooltipWidth,
Expand Down Expand Up @@ -686,7 +686,7 @@ class _ToolTipWidgetState extends State<ToolTipWidget>
).animate(_movingAnimation),
child: Material(
color: Colors.transparent,
child: GestureDetector(
child: InkWell(
onTap: widget.onTooltipTap,
child: Container(
padding: EdgeInsets.only(
Expand Down

0 comments on commit f3f47c0

Please sign in to comment.