render method

  1. @override
void render(
  1. Buffer buffer,
  2. Rect area
)
override

Renders the widget onto the provided buffer within the specified area.

Implementation

@override
void render(Buffer buffer, Rect area) {
  if (area.width <= 0 || area.height <= 0) return;
  final constraints = children
      .map((c) => _getConstraint(c, LayoutDirection.horizontal))
      .toList();
  final rects = splitRect(area, constraints, LayoutDirection.horizontal);
  for (var i = 0; i < children.length; i++) {
    final child = _getRealWidget(children[i]);
    final childArea = rects[i];
    final viewport = Viewport(buffer, childArea);
    child.render(viewport, Rect(0, 0, childArea.width, childArea.height));
  }
}