getDistanceToActualBaseline method

  1. @protected
  2. @mustCallSuper
double? getDistanceToActualBaseline(
  1. TextBaseline baseline

Calls computeDistanceToActualBaseline and caches the result.

This function must only be called from getDistanceToBaseline and computeDistanceToActualBaseline. Do not call this function directly from outside those two methods.


double? getDistanceToActualBaseline(TextBaseline baseline) {
  assert(_debugDoingBaseline, 'Please see the documentation for computeDistanceToActualBaseline for the required calling conventions of this method.');
  _cachedBaselines ??= <TextBaseline, double?>{};
  return _cachedBaselines!.putIfAbsent(baseline, () => computeDistanceToActualBaseline(baseline));