Skip to content

Commit

Permalink
fix: 🐛 Fixed Extra padding when add targetShapeBorder (#452) (#454)
Browse files Browse the repository at this point in the history
* fix: 🐛 Fixed Extra padding when add targetShapeBorder (#452)

* fix: repository url update in pubspec.yaml

---------

Co-authored-by: Manoj Padiya <[email protected]>
Co-authored-by: Vatsal Tanna <[email protected]>
  • Loading branch information
3 people authored May 31, 2024
1 parent fbf43c2 commit a635729
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 37 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
29 changes: 0 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
<ul>
<li>title</li>
<li>titleAlignment</li>
<li>titleTextStyle</li>
<li>description</li>
<li>descriptionAlignment</li>
<li>descTextStyle</li>
<li>textColor</li>
<li>tooltipBackgroundColor</li>
<li>tooltipBorderRadius</li>
<li>tooltipPadding</li>
</ul>

## Installing

1. Add dependency to `pubspec.yaml`
Expand Down
16 changes: 9 additions & 7 deletions lib/src/showcase.dart
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,7 @@ class _ShowcaseState extends State<Showcase> {
onLongPress: widget.onTargetLongPress,
shapeBorder: widget.targetShapeBorder,
disableDefaultChildGestures: widget.disableDefaultTargetGestures,
targetPadding: widget.targetPadding,
),
ToolTipWidget(
position: position,
Expand Down Expand Up @@ -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,
Expand All @@ -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(),
Expand All @@ -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!)
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down

0 comments on commit a635729

Please sign in to comment.