getLabelHeight method

double getLabelHeight(
  1. Iterable<TextElement> labelElements
)

The height of the label (handles labels spanning multiple lines).

Implementation

double getLabelHeight(Iterable<TextElement> labelElements) {
  if (labelElements.isEmpty) return 0;
  final textHeight = labelElements.first.measurement.verticalSliceWidth;
  final numLines = labelElements.length;
  return (textHeight * numLines) + (multiLineLabelPadding * (numLines - 1));
}