Skip to content

Commit 377b7d9

Browse files
authored
Merge pull request #110 from Sourav-Sonkar/bug/shadows
Pass multiple shadow or custom shadow
2 parents 8c1fffe + 6f4492b commit 377b7d9

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

lib/src/super_tooltip.dart

+12-9
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ class SuperTooltip extends StatefulWidget {
5858
final bool showDropBoxFilter;
5959
final double sigmaX;
6060
final double sigmaY;
61+
final List<BoxShadow>? boxShadows;
6162

6263
SuperTooltip({
6364
Key? key,
@@ -128,6 +129,7 @@ class SuperTooltip extends StatefulWidget {
128129
this.showDropBoxFilter = false,
129130
this.hideTooltipOnBarrierTap = true,
130131
this.toggleOnTap = false,
132+
this.boxShadows,
131133
}) : assert(showDropBoxFilter ? showBarrier ?? false : true,
132134
'showDropBoxFilter or showBarrier can\'t be false | null'),
133135
super(key: key);
@@ -216,7 +218,7 @@ class _SuperTooltipState extends State<SuperTooltip>
216218
child: GestureDetector(
217219
onTap: () {
218220
if (widget.toggleOnTap && _superTooltipController!.isVisible) {
219-
_superTooltipController!.hideTooltip();
221+
_superTooltipController!.hideTooltip();
220222
} else {
221223
_superTooltipController!.showTooltip();
222224
}
@@ -402,14 +404,15 @@ class _SuperTooltipState extends State<SuperTooltip>
402404
ShapeDecoration(
403405
color: backgroundColor,
404406
shadows: hasShadow
405-
? <BoxShadow>[
406-
BoxShadow(
407-
blurRadius: shadowBlurRadius,
408-
spreadRadius: shadowSpreadRadius,
409-
color: shadowColor,
410-
offset: shadowOffset,
411-
),
412-
]
407+
? widget.boxShadows ??
408+
<BoxShadow>[
409+
BoxShadow(
410+
blurRadius: shadowBlurRadius,
411+
spreadRadius: shadowSpreadRadius,
412+
color: shadowColor,
413+
offset: shadowOffset,
414+
),
415+
]
413416
: null,
414417
shape: BubbleShape(
415418
arrowBaseWidth: widget.arrowBaseWidth,

0 commit comments

Comments
 (0)