minimumSizeFor method
Implementation
@override
DiagramSize minimumSizeFor(
FramedElement shape,
Map<String, double> textHeights,
) {
if (!_visible(shape, visibleWhen)) {
return const DiagramSize(0, 0);
}
final size = child.minimumSizeFor(shape, textHeights);
// Once measured, a content section is exactly as tall as its content.
if (contentHeightSlot case final slot?) {
return DiagramSize(
size.width,
textHeights[contentHeightKey(slot)] ?? size.height,
);
}
final heightSlot = textHeightSlot;
return heightSlot == null
? size
: DiagramSize(
size.width,
math.max(size.height, (textHeights[heightSlot] ?? 0) + 12),
);
}