Skip to content

Commit 817e005

Browse files
fix: 🐛Fixed cursor not changing to click mode issue (#503) (#504)
1 parent ea99366 commit 817e005

File tree

4 files changed

+175
-152
lines changed

4 files changed

+175
-152
lines changed

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
## [4.1.0] - (UnRelease)
22
- Feature [#500](https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/issues/500) -
33
Added `onDismiss` callback in `ShowCaseWidget` which will trigger whenever `onDismiss` method is
4-
called
4+
called.
5+
- Fixed [#503](https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/issues/503) - Cursor
6+
not changing to click mode when it is hovering over the clickable widgets provided by this
7+
package.
58

69
## [4.0.1]
710
- Fixed [#493](https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/issues/493) - ShowCase.withWidget not showing issue

lib/src/showcase.dart

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -807,7 +807,10 @@ class _ShowcaseState extends State<Showcase> {
807807
showArrow: widget.showArrow,
808808
contentHeight: widget.height,
809809
contentWidth: widget.width,
810-
onTooltipTap: _getOnTooltipTap,
810+
onTooltipTap:
811+
widget.disposeOnTap == true || widget.onToolTipClick != null
812+
? _getOnTooltipTap
813+
: null,
811814
tooltipPadding: widget.tooltipPadding,
812815
disableMovingAnimation: widget.disableMovingAnimation ??
813816
showCaseWidgetState.disableMovingAnimation,
@@ -908,7 +911,10 @@ class _TargetWidget extends StatelessWidget {
908911
? IgnorePointer(
909912
child: targetWidgetContent(),
910913
)
911-
: targetWidgetContent(),
914+
: MouseRegion(
915+
cursor: SystemMouseCursors.click,
916+
child: targetWidgetContent(),
917+
),
912918
);
913919
}
914920

lib/src/tooltip_action_button_widget.dart

Lines changed: 31 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -21,35 +21,38 @@ class TooltipActionButtonWidget extends StatelessWidget {
2121
final theme = Theme.of(context);
2222

2323
return config.button ??
24-
GestureDetector(
25-
onTap: handleOnTap,
26-
child: Container(
27-
padding: config.padding,
28-
decoration: BoxDecoration(
29-
color: config.backgroundColor ?? theme.primaryColor,
30-
borderRadius: config.borderRadius,
31-
border: config.border,
32-
),
33-
child: Row(
34-
mainAxisSize: MainAxisSize.min,
35-
children: [
36-
if (config.leadIcon != null)
37-
Padding(
38-
padding: config.leadIcon?.padding ??
39-
const EdgeInsets.only(right: 5),
40-
child: config.leadIcon?.icon,
41-
),
42-
Text(
43-
config.name ?? config.type?.actionName ?? '',
44-
style: config.textStyle,
45-
),
46-
if (config.tailIcon != null)
47-
Padding(
48-
padding: config.tailIcon?.padding ??
49-
const EdgeInsets.only(left: 5),
50-
child: config.tailIcon?.icon,
24+
MouseRegion(
25+
cursor: SystemMouseCursors.click,
26+
child: GestureDetector(
27+
onTap: handleOnTap,
28+
child: Container(
29+
padding: config.padding,
30+
decoration: BoxDecoration(
31+
color: config.backgroundColor ?? theme.primaryColor,
32+
borderRadius: config.borderRadius,
33+
border: config.border,
34+
),
35+
child: Row(
36+
mainAxisSize: MainAxisSize.min,
37+
children: [
38+
if (config.leadIcon != null)
39+
Padding(
40+
padding: config.leadIcon?.padding ??
41+
const EdgeInsets.only(right: 5),
42+
child: config.leadIcon?.icon,
43+
),
44+
Text(
45+
config.name ?? config.type?.actionName ?? '',
46+
style: config.textStyle,
5147
),
52-
],
48+
if (config.tailIcon != null)
49+
Padding(
50+
padding: config.tailIcon?.padding ??
51+
const EdgeInsets.only(left: 5),
52+
child: config.tailIcon?.icon,
53+
),
54+
],
55+
),
5356
),
5457
),
5558
);

0 commit comments

Comments
 (0)