Skip to content

Commit d614d2b

Browse files
authored
Merge pull request #168 from bensonarafat/develop
Delete makedoc.bat
2 parents bf70dfa + 95c7856 commit d614d2b

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

lib/src/super_tooltip.dart

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,9 @@ class SuperTooltip extends StatefulWidget {
327327
/// Defaults to `false`.
328328
final bool clickThrough;
329329

330+
//scroll dismiss
331+
final bool hideTooltipOnScroll;
332+
330333
/// Whether to automatically show the tooltip when the mouse pointer hovers over the [child].
331334
///
332335
/// This feature utilizes [MouseRegion] and is primarily intended for Web and Desktop platforms.
@@ -434,6 +437,7 @@ class SuperTooltip extends StatefulWidget {
434437
this.clickThrough = false,
435438
this.showOnHover = false,
436439
this.hideOnHoverExit = false,
440+
this.hideTooltipOnScroll = false,
437441
this.waitDuration = Duration.zero,
438442
this.showDuration,
439443
this.exitDuration = const Duration(milliseconds: 100),
@@ -761,6 +765,16 @@ class _SuperTooltipState extends State<SuperTooltip>
761765
onTap: widget.hideTooltipOnBarrierTap
762766
? _superTooltipController!.hideTooltip
763767
: null,
768+
onVerticalDragUpdate: (_) {
769+
if (widget.hideTooltipOnScroll) {
770+
_superTooltipController!.hideTooltip();
771+
}
772+
},
773+
onHorizontalDragUpdate: (_) {
774+
if (widget.hideTooltipOnScroll) {
775+
_superTooltipController!.hideTooltip();
776+
}
777+
},
764778
child: Container(
765779
key: SuperTooltip.barrierKey,
766780
decoration: ShapeDecoration(
@@ -835,6 +849,16 @@ class _SuperTooltipState extends State<SuperTooltip>
835849
_superTooltipController!.hideTooltip();
836850
}
837851
},
852+
onVerticalDragUpdate: (_) {
853+
if (widget.hideTooltipOnScroll) {
854+
_superTooltipController!.hideTooltip();
855+
}
856+
},
857+
onHorizontalDragUpdate: (_) {
858+
if (widget.hideTooltipOnScroll) {
859+
_superTooltipController!.hideTooltip();
860+
}
861+
},
838862
child: Container(
839863
key: SuperTooltip.bubbleKey,
840864
margin: SuperUtils.getTooltipMargin(

0 commit comments

Comments
 (0)