minimumSizeFor method

  1. @override
DiagramSize minimumSizeFor(
  1. FramedElement shape,
  2. Map<String, double> textHeights
)
override

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),
        );
}