paint method

void paint({
  1. required Axis dividerAxis,
  2. required bool resizable,
  3. required bool highlighted,
  4. required Canvas canvas,
  5. required Size dividerSize,
  6. required Map<int, dynamic> animatedValues,
})

Paints the divider.

Implementation

void paint(
    {required Axis dividerAxis,
    required bool resizable,
    required bool highlighted,
    required Canvas canvas,
    required Size dividerSize,
    required Map<int, dynamic> animatedValues}) {
  Color? color = backgroundColor;
  if (animationEnabled && animatedValues.containsKey(backgroundKey)) {
    color = animatedValues[backgroundKey];
  } else if (highlighted && highlightedBackgroundColor != null) {
    color = highlightedBackgroundColor;
  }

  if (color != null) {
    var paint = Paint()
      ..style = PaintingStyle.fill
      ..color = color
      ..isAntiAlias = true;
    canvas.drawRect(
        Rect.fromLTWH(0, 0, dividerSize.width, dividerSize.height), paint);
  }
}