getFullHeightForCaret method

double? getFullHeightForCaret(
  1. TextPosition position,
  2. Rect caretPrototype
)

Returns the strut bounded height of the glyph at the given position.

Valid only after layout has been called.

Implementation

double? getFullHeightForCaret(TextPosition position, Rect caretPrototype) {
  if (position.offset < 0) {
    // TODO(LongCatIsLooong): make this case impossible; see https://github.com/flutter/flutter/issues/79495
    return null;
  }
  return switch (_computeCaretMetrics(position)) {
    _LineCaretMetrics(:final double fullHeight) => fullHeight,
    _EmptyLineCaretMetrics() => null,
  };
}