debugPaint method

  1. @override
void debugPaint(
  1. Context context
)
override

Implementation

@override
void debugPaint(Context context) {
  super.debugPaint(context);

  if (children.isEmpty) {
    return;
  }

  context.canvas
    ..setFillColor(PdfColors.lime)
    ..moveTo(box!.left, box!.bottom)
    ..lineTo(box!.right, box!.bottom)
    ..lineTo(box!.right, box!.top)
    ..lineTo(box!.left, box!.top)
    ..moveTo(box!.left + padding.left, box!.bottom + padding.bottom)
    ..lineTo(box!.left + padding.left, box!.top - padding.top)
    ..lineTo(box!.right - padding.right, box!.top - padding.top)
    ..lineTo(box!.right - padding.right, box!.bottom + padding.bottom)
    ..fillPath();

  for (var c = 1; c < crossAxisCount; c++) {
    switch (direction) {
      case Axis.vertical:
        context.canvas
          ..drawRect(
              box!.left +
                  padding.left +
                  (_context.childCrossAxis! + crossAxisSpacing) * c -
                  crossAxisSpacing,
              box!.bottom + padding.bottom,
              math.max(crossAxisSpacing, 1),
              box!.height - padding.vertical)
          ..fillPath();
        break;
      case Axis.horizontal:
        context.canvas
          ..drawRect(
              box!.left + padding.left,
              box!.bottom +
                  padding.bottom +
                  (_context.childCrossAxis! + crossAxisSpacing) * c -
                  crossAxisSpacing,
              box!.width - padding.horizontal,
              math.max(crossAxisSpacing, 1))
          ..fillPath();
        break;
    }
  }

  for (var c = 1; c < _mainAxisCount!; c++) {
    switch (direction) {
      case Axis.vertical:
        context.canvas
          ..drawRect(
              box!.left + padding.left,
              box!.bottom +
                  padding.bottom +
                  (_context.childMainAxis! + mainAxisSpacing) * c -
                  mainAxisSpacing,
              box!.width - padding.horizontal,
              math.max(mainAxisSpacing, 1))
          ..fillPath();
        break;
      case Axis.horizontal:
        context.canvas
          ..drawRect(
              box!.left +
                  padding.left +
                  (_context.childMainAxis! + mainAxisSpacing) * c -
                  mainAxisSpacing,
              box!.bottom + padding.bottom,
              math.max(mainAxisSpacing, 1),
              box!.height - padding.vertical)
          ..fillPath();
        break;
    }
  }
}