Skip to content

Commit

Permalink
fix: 🐛 #346 Don't respond to any clicks in target & (#351)
Browse files Browse the repository at this point in the history
#348 showcaseview after upgrade to flutter 3.7.1 not disable target click
  • Loading branch information
vatsaltanna authored Mar 10, 2023
1 parent 3a8c112 commit 45e8225
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 20 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## [2.0.2]
- Fixed [#335](https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/issues/335) - Fixed flutter inspector makes screen grey
- Fixed [#346](https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/issues/346) - Dont respond to any clicks in target.

## [2.0.1]
- Feature [#306](https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/pull/306) - Added support of manual vertical tooltip position.
Expand Down
45 changes: 25 additions & 20 deletions lib/src/showcase.dart
Original file line number Diff line number Diff line change
Expand Up @@ -586,26 +586,31 @@ class _TargetWidget extends StatelessWidget {
return Positioned(
top: offset.dy,
left: offset.dx,
child: IgnorePointer(
ignoring: disableDefaultChildGestures,
child: FractionalTranslation(
translation: const Offset(-0.5, -0.5),
child: GestureDetector(
onTap: onTap,
onLongPress: onLongPress,
onDoubleTap: onDoubleTap,
child: Container(
height: size!.height + 16,
width: size!.width + 16,
decoration: ShapeDecoration(
shape: radius != null
? RoundedRectangleBorder(borderRadius: radius!)
: shapeBorder ??
const RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(8)),
),
),
),
child: disableDefaultChildGestures
? IgnorePointer(
child: targetWidgetContent(),
)
: targetWidgetContent(),
);
}

Widget targetWidgetContent() {
return FractionalTranslation(
translation: const Offset(-0.5, -0.5),
child: GestureDetector(
onTap: onTap,
onLongPress: onLongPress,
onDoubleTap: onDoubleTap,
child: Container(
height: size!.height + 16,
width: size!.width + 16,
decoration: ShapeDecoration(
shape: radius != null
? RoundedRectangleBorder(borderRadius: radius!)
: shapeBorder ??
const RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(8)),
),
),
),
),
Expand Down

0 comments on commit 45e8225

Please sign in to comment.