layout method
Lays out the child with the specified constraints and returns its size.
This method should only be called inside BoxyDelegate.layout.
See also:
- layoutWithoutSize, which is more efficient if you don't need the child's size.
- layoutRect, which positions the child so that it fits in a rect.
- layoutFit, which positions and scales the child given a BoxFit.
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);
}