Skip to content

Commit 45e8225

Browse files
authored
fix: 🐛 #346 Don't respond to any clicks in target & (#351)
#348 showcaseview after upgrade to flutter 3.7.1 not disable target click
1 parent 3a8c112 commit 45e8225

2 files changed

Lines changed: 26 additions & 20 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
## [2.0.2]
22
- Fixed [#335](https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/issues/335) - Fixed flutter inspector makes screen grey
3+
- Fixed [#346](https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/issues/346) - Dont respond to any clicks in target.
34

45
## [2.0.1]
56
- Feature [#306](https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/pull/306) - Added support of manual vertical tooltip position.

lib/src/showcase.dart

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -586,26 +586,31 @@ class _TargetWidget extends StatelessWidget {
586586
return Positioned(
587587
top: offset.dy,
588588
left: offset.dx,
589-
child: IgnorePointer(
590-
ignoring: disableDefaultChildGestures,
591-
child: FractionalTranslation(
592-
translation: const Offset(-0.5, -0.5),
593-
child: GestureDetector(
594-
onTap: onTap,
595-
onLongPress: onLongPress,
596-
onDoubleTap: onDoubleTap,
597-
child: Container(
598-
height: size!.height + 16,
599-
width: size!.width + 16,
600-
decoration: ShapeDecoration(
601-
shape: radius != null
602-
? RoundedRectangleBorder(borderRadius: radius!)
603-
: shapeBorder ??
604-
const RoundedRectangleBorder(
605-
borderRadius: BorderRadius.all(Radius.circular(8)),
606-
),
607-
),
608-
),
589+
child: disableDefaultChildGestures
590+
? IgnorePointer(
591+
child: targetWidgetContent(),
592+
)
593+
: targetWidgetContent(),
594+
);
595+
}
596+
597+
Widget targetWidgetContent() {
598+
return FractionalTranslation(
599+
translation: const Offset(-0.5, -0.5),
600+
child: GestureDetector(
601+
onTap: onTap,
602+
onLongPress: onLongPress,
603+
onDoubleTap: onDoubleTap,
604+
child: Container(
605+
height: size!.height + 16,
606+
width: size!.width + 16,
607+
decoration: ShapeDecoration(
608+
shape: radius != null
609+
? RoundedRectangleBorder(borderRadius: radius!)
610+
: shapeBorder ??
611+
const RoundedRectangleBorder(
612+
borderRadius: BorderRadius.all(Radius.circular(8)),
613+
),
609614
),
610615
),
611616
),

0 commit comments

Comments
 (0)