paint method

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

Draw itself and its children, according to the calculated box.offset

Implementation

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

  final resolved = _layout;
  final visible = _visible;
  if (resolved == null || visible == null || visible.rows.isEmpty) {
    return;
  }

  final mat = Matrix4.identity();
  mat.translateByDouble(box!.left, box!.bottom, 0, 1);
  context.canvas
    ..saveContext()
    ..setTransform(mat)
    ..drawRect(0, 0, box!.width, visible.totalHeight)
    ..clipPath();

  _paintRows(context, resolved, visible, PaintPhase.background);
  _paintCells(context, resolved, visible);
  _paintRows(context, resolved, visible, PaintPhase.foreground);
  if (border != null) {
    _paintBorder(context, resolved, visible);
  }

  context.canvas.restoreContext();
}