From a63572974566ca69a68947c4b5554b1c3afa4446 Mon Sep 17 00:00:00 2001 From: Manoj <96906187+manoj-simform@users.noreply.github.com> Date: Fri, 31 May 2024 21:56:25 +0530 Subject: [PATCH] fix: :bug: Fixed Extra padding when add targetShapeBorder (#452) (#454) * fix: :bug: Fixed Extra padding when add targetShapeBorder (#452) * fix: repository url update in pubspec.yaml --------- Co-authored-by: Manoj Padiya Co-authored-by: Vatsal Tanna --- CHANGELOG.md | 1 + README.md | 29 ----------------------------- lib/src/showcase.dart | 16 +++++++++------- pubspec.yaml | 2 +- 4 files changed, 11 insertions(+), 37 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 69d9f586..45a853a6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ - Updated minimum support to dart sdk 2.18.0 - Fixed [#449](https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/issues/449) - Null check operator used on a null value - [BREAKING] Improvement [#400](https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/issues/400) - remove Builder widget +- Fixed [#435](https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/issues/435) - Extra padding when add targetShapeBorder ## [2.1.1] - Fixed [#425](https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/issues/425) - Unhandled breaking change in v2.1.0 diff --git a/README.md b/README.md index 0925c40a..bd2941c2 100644 --- a/README.md +++ b/README.md @@ -30,35 +30,6 @@ ShowCaseWidget( ), ``` -## Migration guide for release 2.0.0 -Renamed properties/fields of widgets mentioned below in the table. - -| Before | After | -|-------------------------|--------------------------| -| autoPlayLockEnable | enableAutoPlayLock | -| shapeBorder | targetShapeBorder | -| showcaseBackgroundColor | tooltipBackgroundColor | -| contentPadding | tooltipPadding | -| overlayPadding | targetPadding | -| radius | targetBorderRadius | -| tipBorderRadius | tooltipBorderRadius | -| disableAnimation | disableMovingAnimation | -| animationDuration | movingAnimationDuration | - -Removed unused parameter of `Showcase.withWidget()` mentioned below: - - ## Installing 1. Add dependency to `pubspec.yaml` diff --git a/lib/src/showcase.dart b/lib/src/showcase.dart index 33fbe5a6..1779f98b 100644 --- a/lib/src/showcase.dart +++ b/lib/src/showcase.dart @@ -596,6 +596,7 @@ class _ShowcaseState extends State { onLongPress: widget.onTargetLongPress, shapeBorder: widget.targetShapeBorder, disableDefaultChildGestures: widget.disableDefaultTargetGestures, + targetPadding: widget.targetPadding, ), ToolTipWidget( position: position, @@ -647,11 +648,13 @@ class _TargetWidget extends StatelessWidget { final ShapeBorder shapeBorder; final BorderRadius? radius; final bool disableDefaultChildGestures; + final EdgeInsets targetPadding; const _TargetWidget({ required this.offset, required this.size, required this.shapeBorder, + required this.targetPadding, this.onTap, this.radius, this.onDoubleTap, @@ -662,9 +665,8 @@ class _TargetWidget extends StatelessWidget { @override Widget build(BuildContext context) { return Positioned( - //TODO: Add target padding in major version upgrade - top: offset.dy, - left: offset.dx, + top: offset.dy - targetPadding.top, + left: offset.dx - targetPadding.left, child: disableDefaultChildGestures ? IgnorePointer( child: targetWidgetContent(), @@ -678,11 +680,11 @@ class _TargetWidget extends StatelessWidget { onTap: onTap, onLongPress: onLongPress, onDoubleTap: onDoubleTap, + behavior: HitTestBehavior.translucent, child: Container( - //TODO: Add target padding in major version upgrade and - // remove default 16 padding from this widget - height: size.height + 16, - width: size.width + 16, + height: size.height, + width: size.width, + margin: targetPadding, decoration: ShapeDecoration( shape: radius != null ? RoundedRectangleBorder(borderRadius: radius!) diff --git a/pubspec.yaml b/pubspec.yaml index 3cf76642..51a0d880 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: showcaseview description: A Flutter package to Showcase/Highlight widgets step by step. version: 3.0.0 -issue_tracker: https://github.com/simformsolutions/flutter_showcaseview/issues +issue_tracker: https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/issues repository: https://github.com/simformsolutions/flutter_showcaseview environment: