LabelPainter constructor
LabelPainter({
- double opacity = 1,
- bool hasArrow = false,
- bool hasLabelBox = false,
- ArrowPosition arrowPosition = ArrowPosition.top,
- double arrowHeight = kArrowHeight,
- EdgeInsets labelBoxPadding = const EdgeInsets.all(8.0),
- BoxDecoration labelBoxDecoration = const BoxDecoration(shape: BoxShape.rectangle, borderRadius: BorderRadius.all(Radius.circular(8.0)), color: transparentColor),
- required Rect hole,
- required bool isTop,
Implementation
LabelPainter({
this.opacity = 1,
this.hasArrow = false,
this.hasLabelBox = false,
this.arrowPosition = ArrowPosition.top,
this.arrowHeight = kArrowHeight,
this.labelBoxPadding = const EdgeInsets.all(8.0),
this.labelBoxDecoration = const BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.all(Radius.circular(8.0)),
color: transparentColor,
),
required this.hole,
required this.isTop,
}) : assert(
(hasArrow && hasLabelBox) ||
(!hasArrow && !hasLabelBox) ||
!hasArrow && hasLabelBox,
'hasArrow $hasArrow cannot be true if hasLabelBox $hasLabelBox is false'),
_decoration = labelBoxDecoration.copyWith(
shape: BoxShape.rectangle,
);