From 6f4492bf317ac27835b4ae957a54d68988b564e7 Mon Sep 17 00:00:00 2001 From: Sourav-Sonkar Date: Thu, 18 Jul 2024 17:07:01 +0530 Subject: [PATCH] option to add multiple/custom shadow --- lib/src/super_tooltip.dart | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/lib/src/super_tooltip.dart b/lib/src/super_tooltip.dart index a404796..207f460 100644 --- a/lib/src/super_tooltip.dart +++ b/lib/src/super_tooltip.dart @@ -58,6 +58,7 @@ class SuperTooltip extends StatefulWidget { final bool showDropBoxFilter; final double sigmaX; final double sigmaY; + final List? boxShadows; SuperTooltip({ Key? key, @@ -128,6 +129,7 @@ class SuperTooltip extends StatefulWidget { this.showDropBoxFilter = false, this.hideTooltipOnBarrierTap = true, this.toggleOnTap = false, + this.boxShadows, }) : assert(showDropBoxFilter ? showBarrier ?? false : true, 'showDropBoxFilter or showBarrier can\'t be false | null'), super(key: key); @@ -216,7 +218,7 @@ class _SuperTooltipState extends State child: GestureDetector( onTap: () { if (widget.toggleOnTap && _superTooltipController!.isVisible) { - _superTooltipController!.hideTooltip(); + _superTooltipController!.hideTooltip(); } else { _superTooltipController!.showTooltip(); } @@ -402,14 +404,15 @@ class _SuperTooltipState extends State ShapeDecoration( color: backgroundColor, shadows: hasShadow - ? [ - BoxShadow( - blurRadius: shadowBlurRadius, - spreadRadius: shadowSpreadRadius, - color: shadowColor, - offset: shadowOffset, - ), - ] + ? widget.boxShadows ?? + [ + BoxShadow( + blurRadius: shadowBlurRadius, + spreadRadius: shadowSpreadRadius, + color: shadowColor, + offset: shadowOffset, + ), + ] : null, shape: BubbleShape( arrowBaseWidth: widget.arrowBaseWidth,