createBoxPainter method

  1. @override
BoxPainter createBoxPainter([
  1. VoidCallback? onChanged
])
override

Returns a BoxPainter that will paint this decoration.

The onChanged argument configures BoxPainter.onChanged. It can be omitted if there is no chance that the painter will change (for example, if it is a BoxDecoration with definitely no DecorationImage).

Implementation

@override
BoxPainter createBoxPainter([VoidCallback? onChanged]) {
  return BadgePainter(
    badgeSize: badgeSize,
    badgeCornerRadius: badgeCornerRadius,
    badgePosition: badgePosition.fromTextDirection(textDirection),
    textSpanBaselineShift: spanBaselineShift,
    textSpanOffset: Offset(spanHorizontalOffset, 0),
    textDirection: textDirection,
    color: color,
    gradient: gradient,
    textSpan: textSpan,
    shadow: badgeShadow,
    isEmoji: isEmoji,
  );
}