From 7f110fe732ac2447f4cfd68a64bc2ff557bc3b23 Mon Sep 17 00:00:00 2001 From: Till Friebe Date: Sat, 27 Mar 2021 18:06:05 +0100 Subject: [PATCH] Add documentation comment for getOffsetToRevealCursor --- lib/widgets/editor.dart | 5 +++++ 1 file changed, 5 insertions(+) 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);