layout method

SliverSize layout(
  1. BoxConstraints constraints
)

Lays out the child with the specified constraints and returns its size.

This method should only be called inside BoxyDelegate.layout.

See also:

Implementation

SliverSize layout(BoxConstraints constraints) {
  if (_parent.isDryLayout) {
    if (_parentData.drySize != null) {
      throw FlutterError(
          'The ${_parent.delegate} boxy delegate tried to lay out the child with id "$id" more than once.\n'
          'Each child must be laid out exactly once.');
    }
    _parentData.drySize = render.getDryLayout(constraints);
    return _parent.wrapSize(_parentData.drySize!);
  }

  _checkConstraints(constraints);

  render.layout(constraints, parentUsesSize: true);

  return _parent.wrapSize(render.size);
}