toPainter method
CustomPainter
toPainter({
- Color backgroundColor = Colors.black54,
- Color borderColor = Colors.transparent,
- ZeroTooltipPosition position = ZeroTooltipPosition.top,
toPainter is used to convert the ZeroTooltipVariant to CustomPainter
the backgroundColor is the background color of the tooltip
the borderColor is the border color of the tooltip
the position is the position of the tooltip
this function is used in ZeroTooltip widget
Implementation
CustomPainter toPainter({
Color backgroundColor = Colors.black54,
Color borderColor = Colors.transparent,
ZeroTooltipPosition position = ZeroTooltipPosition.top,
}) {
switch (this) {
case rectangle:
return ZeroTooltipRectangleVariant(
backgroundColor: backgroundColor,
borderColor: borderColor,
position: position,
);
case rounded:
return ZeroTooltipRoundedVariant(
backgroundColor: backgroundColor,
borderColor: borderColor,
position: position,
);
case custom:
return ZeroTooltipCustomVariant(
backgroundColor: backgroundColor,
borderColor: borderColor,
position: position,
);
}
}