Skip to content

Commit

Permalink
moved decoration to Deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
Sourav-Sonkar committed Jul 18, 2024
1 parent 5eb2d3e commit 0684860
Showing 1 changed file with 31 additions and 26 deletions.
57 changes: 31 additions & 26 deletions lib/src/super_tooltip.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ class SuperTooltip extends StatefulWidget {
final Color borderColor;
final BoxConstraints constraints;
final Color? backgroundColor;
@Deprecated('Use decorationBuilder instead')
final Decoration? decoration;
final DecorationBuilder? decorationBuilder;
final double elevation;
final Duration fadeInDuration;
Expand Down Expand Up @@ -105,6 +107,8 @@ class SuperTooltip extends StatefulWidget {
//
//
//
// TD: Deprecate this in favor of decorationBuilder
this.decoration,
this.decorationBuilder,
this.child,
this.borderColor = Colors.black,
Expand Down Expand Up @@ -404,33 +408,34 @@ class _SuperTooltipState extends State<SuperTooltip>
),
decoration: widget.decorationBuilder != null
? widget.decorationBuilder!(target)
: ShapeDecoration(
color: backgroundColor,
shadows: hasShadow
? <BoxShadow>[
BoxShadow(
blurRadius: shadowBlurRadius,
spreadRadius: shadowSpreadRadius,
color: shadowColor,
offset: shadowOffset,
),
]
: null,
shape: BubbleShape(
arrowBaseWidth: widget.arrowBaseWidth,
arrowTipDistance: widget.arrowTipDistance,
borderColor: widget.borderColor,
borderRadius: widget.borderRadius,
borderWidth: widget.borderWidth,
bottom: bottom,
left: left,
preferredDirection: preferredDirection,
right: right,
target: target,
top: top,
bubbleDimensions: widget.bubbleDimensions,
: widget.decoration ??
ShapeDecoration(
color: backgroundColor,
shadows: hasShadow
? <BoxShadow>[
BoxShadow(
blurRadius: shadowBlurRadius,
spreadRadius: shadowSpreadRadius,
color: shadowColor,
offset: shadowOffset,
),
]
: null,
shape: BubbleShape(
arrowBaseWidth: widget.arrowBaseWidth,
arrowTipDistance: widget.arrowTipDistance,
borderColor: widget.borderColor,
borderRadius: widget.borderRadius,
borderWidth: widget.borderWidth,
bottom: bottom,
left: left,
preferredDirection: preferredDirection,
right: right,
target: target,
top: top,
bubbleDimensions: widget.bubbleDimensions,
),
),
),
child: widget.content,
),
),
Expand Down

0 comments on commit 0684860

Please sign in to comment.