Skip to content

Commit

Permalink
Merge pull request #116 from ryannapp-fedex/feature/external-animatio…
Browse files Browse the repository at this point in the history
…n-control

Feature Request: Allow External Control of Tooltip Animation #115
  • Loading branch information
bensonarafat authored Aug 31, 2024
2 parents ced6e5c + 81fa5f0 commit b637f1f
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions lib/src/super_tooltip.dart
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ class SuperTooltip extends StatefulWidget {
final bool hideTooltipOnTap;
final bool hideTooltipOnBarrierTap;
final bool toggleOnTap;
final bool showOnTap;

//filter
final bool showDropBoxFilter;
Expand Down Expand Up @@ -133,6 +134,7 @@ class SuperTooltip extends StatefulWidget {
this.showDropBoxFilter = false,
this.hideTooltipOnBarrierTap = true,
this.toggleOnTap = false,
this.showOnTap = true,
this.boxShadows,
}) : assert(showDropBoxFilter ? showBarrier ?? false : true,
'showDropBoxFilter or showBarrier can\'t be false | null'),
Expand Down Expand Up @@ -221,11 +223,13 @@ class _SuperTooltipState extends State<SuperTooltip>
link: _layerLink,
child: GestureDetector(
onTap: () {
if (widget.toggleOnTap && _superTooltipController!.isVisible) {
_superTooltipController!.hideTooltip();
} else {
_superTooltipController!.showTooltip();
}
if (widget.toggleOnTap && _superTooltipController!.isVisible) {
_superTooltipController!.hideTooltip();
} else {
if (widget.showOnTap) {
_superTooltipController!.showTooltip();
}
}
},
onLongPress: widget.onLongPress,
child: widget.child,
Expand Down

0 comments on commit b637f1f

Please sign in to comment.