Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 fixes #173 showArrow parameter not working #176

Merged
merged 1 commit into from
Feb 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## [1.1.5] - November 29, 2021 [Unreleased]

- Fixed [#173](https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/issues/173) - showArrow not working

## [1.1.4] - November 26, 2021

- Add glassmorphism effect in showcase background.
Expand Down
66 changes: 35 additions & 31 deletions lib/src/tooltip_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class ToolTipWidget extends StatefulWidget {
final Widget? container;
final Color? tooltipColor;
final Color? textColor;
final bool? showArrow;
final bool showArrow;
final double? contentHeight;
final double? contentWidth;
static late bool isArrowUp;
Expand All @@ -58,7 +58,7 @@ class ToolTipWidget extends StatefulWidget {
this.container,
this.tooltipColor,
this.textColor,
this.showArrow,
required this.showArrow,
this.contentHeight,
this.contentWidth,
this.onTooltipTap,
Expand Down Expand Up @@ -188,7 +188,7 @@ class _ToolTipWidgetState extends State<ToolTipWidget> {
var paddingTop = ToolTipWidget.isArrowUp ? 22.0 : 0.0;
var paddingBottom = ToolTipWidget.isArrowUp ? 0.0 : 27.0;

if (!widget.showArrow!) {
if (!widget.showArrow) {
paddingTop = 10;
paddingBottom = 10;
}
Expand All @@ -211,43 +211,47 @@ class _ToolTipWidgetState extends State<ToolTipWidget> {
child: Material(
color: Colors.transparent,
child: Container(
padding: EdgeInsets.only(
top: paddingTop - (ToolTipWidget.isArrowUp ? arrowHeight : 0),
bottom: paddingBottom -
(ToolTipWidget.isArrowUp ? 0 : arrowHeight),
),
padding: widget.showArrow
? EdgeInsets.only(
top: paddingTop -
(ToolTipWidget.isArrowUp ? arrowHeight : 0),
bottom: paddingBottom -
(ToolTipWidget.isArrowUp ? 0 : arrowHeight),
)
: null,
child: Stack(
alignment: ToolTipWidget.isArrowUp
? Alignment.topLeft
: _getLeft() == null
? Alignment.bottomRight
: Alignment.bottomLeft,
children: [
Positioned(
left: _getLeft() == null
? null
: (widget.position!.getCenter() -
(arrowWidth / 2) -
(_getLeft() ?? 0)),
right: _getLeft() == null
? (MediaQuery.of(context).size.width -
widget.position!.getCenter()) -
(_getRight() ?? 0) -
(arrowWidth / 2)
: null,
child: CustomPaint(
painter: _Arrow(
strokeColor: widget.tooltipColor!,
strokeWidth: 10,
paintingStyle: PaintingStyle.fill,
isUpArrow: ToolTipWidget.isArrowUp,
),
child: SizedBox(
height: arrowHeight,
width: arrowWidth,
if (widget.showArrow)
Positioned(
left: _getLeft() == null
? null
: (widget.position!.getCenter() -
(arrowWidth / 2) -
(_getLeft() ?? 0)),
right: _getLeft() == null
? (MediaQuery.of(context).size.width -
widget.position!.getCenter()) -
(_getRight() ?? 0) -
(arrowWidth / 2)
: null,
child: CustomPaint(
painter: _Arrow(
strokeColor: widget.tooltipColor!,
strokeWidth: 10,
paintingStyle: PaintingStyle.fill,
isUpArrow: ToolTipWidget.isArrowUp,
),
child: SizedBox(
height: arrowHeight,
width: arrowWidth,
),
),
),
),
Padding(
padding: EdgeInsets.only(
top: ToolTipWidget.isArrowUp ? arrowHeight - 1 : 0,
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: showcaseview
description: A Flutter package to Showcase/Highlight widgets step by step.
version: 1.1.4
version: 1.1.5
homepage: https://github.com/simformsolutions/flutter_showcaseview
issue_tracker: https://github.com/simformsolutions/flutter_showcaseview/issues

Expand Down