diff --git a/lib/widgets/editor.dart b/lib/widgets/editor.dart index ef2221c0..0913ffe0 100644 --- a/lib/widgets/editor.dart +++ b/lib/widgets/editor.dart @@ -864,6 +864,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); diff --git a/lib/widgets/raw_editor.dart b/lib/widgets/raw_editor.dart index 11c9c568..73a17e25 100644 --- a/lib/widgets/raw_editor.dart +++ b/lib/widgets/raw_editor.dart @@ -700,6 +700,7 @@ class RawEditorState extends EditorState _keyboardVisible = true; } else { _keyboardVisibilityController = KeyboardVisibilityController(); + _keyboardVisible = _keyboardVisibilityController!.isVisible; _keyboardVisibilitySubscription = _keyboardVisibilityController?.onChange.listen((bool visible) { _keyboardVisible = visible;