diff --git a/lib/widgets/editor.dart b/lib/widgets/editor.dart index 305a58c8..9f4cc24c 100644 --- a/lib/widgets/editor.dart +++ b/lib/widgets/editor.dart @@ -866,6 +866,11 @@ class RenderEditor extends RenderEditableContainerBox ); } + /// Returns the y-offset of the editor at which [selection] is visible. + /// + /// The offset is the distance from the top of the editor and is the minimum + /// from the current scroll position until [selection] becomes visible. + /// Returns null if [selection] is already visible. double? getOffsetToRevealCursor( double viewportHeight, double scrollOffset, double offsetInViewport) { List endpoints = getEndpointsForSelection(selection);