layout method

  1. @override
PwBox layout(
  1. Context context,
  2. BoxConstraints constraints
)
override

layout API.

Implementation

@override
PwBox layout(Context context, BoxConstraints constraints) {
  final PwBox box = child.layout(context, constraints.loosen());
  final double childBase = box.baseline ?? box.size.height;
  final double dy = (baseline - childBase).clamp(0, double.infinity);
  return ProxyBox(
    constraints.constrain(PwSize(box.size.width, dy + box.size.height)),
    child: box,
    childOffset: PwOffset(0, dy),
    baselineOverride: dy + childBase,
  );
}