getDistanceToActualBaseline method
- @protected
- @mustCallSuper
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.
Implementation
@protected
@mustCallSuper
double getDistanceToActualBaseline(TextBaseline baseline) {
assert(_debugDoingBaseline);
_cachedBaselines ??= <TextBaseline, double>{};
_cachedBaselines.putIfAbsent(baseline, () => computeDistanceToActualBaseline(baseline));
return _cachedBaselines[baseline];
}