computeDistanceToActualBaseline method Null safety

double computeDistanceToActualBaseline(
  1. TextBaseline baseline
)

Returns the distance from the top of the text to the first baseline of the given type.

Valid only after layout has been called.

Implementation

double computeDistanceToActualBaseline(TextBaseline baseline) {
  assert(_debugAssertTextLayoutIsValid);
  assert(baseline != null);
  switch (baseline) {
    case TextBaseline.alphabetic:
      return _paragraph!.alphabeticBaseline;
    case TextBaseline.ideographic:
      return _paragraph!.ideographicBaseline;
  }
}