diff --git a/lib/src/widgets/editor.dart b/lib/src/widgets/editor.dart index 71c5a8b4..b16a2818 100644 --- a/lib/src/widgets/editor.dart +++ b/lib/src/widgets/editor.dart @@ -53,7 +53,7 @@ abstract class EditorState extends State RenderEditor get renderEditor; - EditorTextSelectionOverlay? getSelectionOverlay(); + EditorTextSelectionOverlay? get selectionOverlay; /// Controls the floating cursor animation when it is released. /// The floating cursor is animated to merge with the regular cursor. diff --git a/lib/src/widgets/raw_editor.dart b/lib/src/widgets/raw_editor.dart index 401ae176..42119f92 100644 --- a/lib/src/widgets/raw_editor.dart +++ b/lib/src/widgets/raw_editor.dart @@ -238,7 +238,7 @@ class RawEditorState extends EditorState // Selection overlay @override - EditorTextSelectionOverlay? getSelectionOverlay() => _selectionOverlay; + EditorTextSelectionOverlay? get selectionOverlay => _selectionOverlay; EditorTextSelectionOverlay? _selectionOverlay; @override diff --git a/lib/src/widgets/raw_editor/raw_editor_state_selection_delegate_mixin.dart b/lib/src/widgets/raw_editor/raw_editor_state_selection_delegate_mixin.dart index 055c9925..e5c2d979 100644 --- a/lib/src/widgets/raw_editor/raw_editor_state_selection_delegate_mixin.dart +++ b/lib/src/widgets/raw_editor/raw_editor_state_selection_delegate_mixin.dart @@ -99,8 +99,9 @@ mixin RawEditorStateSelectionDelegateMixin on EditorState @override void hideToolbar([bool hideHandles = true]) { - if (getSelectionOverlay()?.toolbar != null) { - getSelectionOverlay()?.hideToolbar(); + // If the toolbar is currently visible. + if (selectionOverlay?.toolbar != null) { + selectionOverlay?.hideToolbar(); } }