computeLayout method
Size
computeLayout(
- BoxConstraints constraints,
- Map<
int, RenderBox> childrenTable, { - 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);
}