computeLayout method

  1. @override
Size computeLayout(
  1. BoxConstraints constraints,
  2. Map<int, RenderBox> childrenTable, {
  3. bool dry = true,
})
inherited

Implementation

@override
Size computeLayout(
  BoxConstraints constraints,
  Map<T, RenderBox> childrenTable, {
  bool dry = true,
}) {
  final sizeMap = <T, Size>{};
  for (final childEntry in childrenTable.entries) {
    sizeMap[childEntry.key] =
        childEntry.value.getLayoutSize(infiniteConstraint, dry: dry);
  }

  final hconf = performHorizontalIntrinsicLayout(
      childrenWidths:
          sizeMap.map((key, value) => MapEntry(key, value.width)));
  final vconf = performVerticalIntrinsicLayout(
    childrenHeights: sizeMap.map((key, value) => MapEntry(key, value.height)),
    childrenBaselines: childrenTable.map((key, value) => MapEntry(
          key,
          dry
              ? 0
              : value.getDistanceToBaseline(TextBaseline.alphabetic,
                  onlyReal: true)!,
        )),
  );

  if (!dry) {
    childrenTable.forEach((id, child) => child.offset =
        Offset(hconf.offsetTable[id]!, vconf.offsetTable[id]!));
  }

  return Size(hconf.size, vconf.size);
}