compute method

List<PositionedComponentInstance> compute(
  1. Size maxSize
)

Computes the layout starting from rootInstance.

Returns a list of PositionedComponentInstance with final positions and sizes for rendering.

Implementation

List<PositionedComponentInstance> compute(Size maxSize) {
  final Size measured = rootInstance.measure(maxSize);
  final Rect rootBounds = Rect(
    x: 0,
    y: 0,
    width: measured.width,
    height: measured.height,
  );
  _layoutRecursiveCompute(rootInstance, rootBounds);

  return result;
}