layout method
layout API.
Implementation
@override
PwBox layout(Context context, BoxConstraints constraints) {
final MultiChildLayoutHost host = MultiChildLayoutHost(constraints, context, {
for (final LayoutId child in children) child.id: child.child,
});
performLayout(host);
final PwSize raw = size?.call(constraints) ?? _span(host, constraints);
return GroupBox(constraints.constrain(raw), <(PwBox, PwOffset)>[
for (final LayoutId child in children)
if (host.boxes[child.id] != null)
(
host.boxes[child.id]!,
host.offsets[child.id] ?? PwOffset.zero,
),
]);
}