pub struct TextSelectionOverlay {
pub context: BuildContext,
pub render_object: RenderHandle<RenderEditable>,
pub selection_controls: Option<Rc<dyn TextSelectionControls>>,
pub selection_delegate: AnyTextSelectionDelegate,
pub context_menu_builder: Option<WidgetBuilder>,
/* private fields */
}Expand description
Fields§
§context: BuildContextThe context in which the selection UI should appear.
render_object: RenderHandle<RenderEditable>The editable line in which the selected text is being displayed.
selection_controls: Option<Rc<dyn TextSelectionControls>>Builds text selection handles and toolbar.
selection_delegate: AnyTextSelectionDelegateThe delegate for manipulating the current selection in the owning text field.
If not provided, no context menu will be built.
Implementations§
Source§impl TextSelectionOverlay
impl TextSelectionOverlay
Sourcepub fn new(
app: &mut App,
value: TextEditingValue,
context: BuildContext,
toolbar_layer_link: Ref<LayerLink>,
start_handle_layer_link: Ref<LayerLink>,
end_handle_layer_link: Ref<LayerLink>,
render_object: RenderHandle<RenderEditable>,
selection_delegate: AnyTextSelectionDelegate,
magnifier_configuration: TextMagnifierConfiguration,
) -> Ref<Self>
pub fn new( app: &mut App, value: TextEditingValue, context: BuildContext, toolbar_layer_link: Ref<LayerLink>, start_handle_layer_link: Ref<LayerLink>, end_handle_layer_link: Ref<LayerLink>, render_object: RenderHandle<RenderEditable>, selection_delegate: AnyTextSelectionDelegate, magnifier_configuration: TextMagnifierConfiguration, ) -> Ref<Self>
Sourcepub fn debug_required_for(
self: Ref<Self>,
app: &mut App,
widget: WidgetRef,
) -> Ref<Self>
pub fn debug_required_for( self: Ref<Self>, app: &mut App, widget: WidgetRef, ) -> Ref<Self>
Dart TextSelectionOverlay(debugRequiredFor:).
Sourcepub fn selection_controls(
self: Ref<Self>,
app: &mut App,
controls: Rc<dyn TextSelectionControls>,
) -> Ref<Self>
pub fn selection_controls( self: Ref<Self>, app: &mut App, controls: Rc<dyn TextSelectionControls>, ) -> Ref<Self>
Dart TextSelectionOverlay(selectionControls:).
Sourcepub fn handles_visible(
self: Ref<Self>,
app: &mut App,
visible: bool,
) -> Ref<Self>
pub fn handles_visible( self: Ref<Self>, app: &mut App, visible: bool, ) -> Ref<Self>
Dart TextSelectionOverlay(handlesVisible:).
Sourcepub fn drag_start_behavior(
self: Ref<Self>,
app: &mut App,
drag_start_behavior: DragStartBehavior,
) -> Ref<Self>
pub fn drag_start_behavior( self: Ref<Self>, app: &mut App, drag_start_behavior: DragStartBehavior, ) -> Ref<Self>
Dart TextSelectionOverlay(dragStartBehavior:).
Sourcepub fn on_selection_handle_tapped(
self: Ref<Self>,
app: &mut App,
on_selection_handle_tapped: Listener,
) -> Ref<Self>
pub fn on_selection_handle_tapped( self: Ref<Self>, app: &mut App, on_selection_handle_tapped: Listener, ) -> Ref<Self>
Dart TextSelectionOverlay(onSelectionHandleTapped:).
Sourcepub fn clipboard_status(
self: Ref<Self>,
app: &mut App,
clipboard_status: Ref<ClipboardStatusNotifier>,
) -> Ref<Self>
pub fn clipboard_status( self: Ref<Self>, app: &mut App, clipboard_status: Ref<ClipboardStatusNotifier>, ) -> Ref<Self>
Dart TextSelectionOverlay(clipboardStatus:).
Dart TextSelectionOverlay(contextMenuBuilder:).
Sourcepub fn value(self: Handle<Self>, app: &App) -> TextEditingValue
pub fn value(self: Handle<Self>, app: &App) -> TextEditingValue
Retrieve current value.
Sourcepub fn handles_visible_value(self: Handle<Self>, app: &App) -> bool
pub fn handles_visible_value(self: Handle<Self>, app: &App) -> bool
Whether selection handles are visible.
Sourcepub fn set_handles_visible(self: Handle<Self>, app: &mut App, visible: bool)
pub fn set_handles_visible(self: Handle<Self>, app: &mut App, visible: bool)
Set to false if you want to hide the handles without rebuilding them.
Sourcepub fn show_handles(self: Handle<Self>, app: &mut App)
pub fn show_handles(self: Handle<Self>, app: &mut App)
Builds the handles by inserting them into the context’s overlay.
Sourcepub fn hide_handles(self: Handle<Self>, app: &mut App)
pub fn hide_handles(self: Handle<Self>, app: &mut App)
Destroys the handles by removing them from overlay.
Sourcepub fn show_toolbar(self: Handle<Self>, app: &mut App)
pub fn show_toolbar(self: Handle<Self>, app: &mut App)
Shows the toolbar by inserting it into the overlay.
Must not be called during the build or layout phase.
Sourcepub fn show_spell_check_suggestions_toolbar(
self: Handle<Self>,
app: &mut App,
spell_check_suggestions_toolbar_builder: WidgetBuilder,
)
pub fn show_spell_check_suggestions_toolbar( self: Handle<Self>, app: &mut App, spell_check_suggestions_toolbar_builder: WidgetBuilder, )
Shows toolbar with spell check suggestions of misspelled words that are available for click-and-replace.
Sourcepub fn show_magnifier(
self: Handle<Self>,
app: &mut App,
position_to_show: Offset,
)
pub fn show_magnifier( self: Handle<Self>, app: &mut App, position_to_show: Offset, )
Shows the magnifier, and hides the toolbar if it was showing.
Sourcepub fn update_magnifier(
self: Handle<Self>,
app: &mut App,
position_to_show: Offset,
)
pub fn update_magnifier( self: Handle<Self>, app: &mut App, position_to_show: Offset, )
Update the current magnifier with new selection data.
Sourcepub fn hide_magnifier(self: Handle<Self>, app: &mut App)
pub fn hide_magnifier(self: Handle<Self>, app: &mut App)
Hide the current magnifier.
Sourcepub fn update(self: Handle<Self>, app: &mut App, new_value: TextEditingValue)
pub fn update(self: Handle<Self>, app: &mut App, new_value: TextEditingValue)
Updates the overlay after the selection has changed.
Sourcepub fn update_for_scroll(self: Handle<Self>, app: &mut App)
pub fn update_for_scroll(self: Handle<Self>, app: &mut App)
Causes the overlay to update its rendering after a scroll or metrics change.
Sourcepub fn handles_are_visible(self: Handle<Self>, app: &App) -> bool
pub fn handles_are_visible(self: Handle<Self>, app: &App) -> bool
Whether the handles are currently visible.
Sourcepub fn toolbar_is_visible(self: Handle<Self>, app: &App) -> bool
pub fn toolbar_is_visible(self: Handle<Self>, app: &App) -> bool
Whether the toolbar is currently visible.
Sourcepub fn magnifier_is_visible(self: Handle<Self>, app: &App) -> bool
pub fn magnifier_is_visible(self: Handle<Self>, app: &App) -> bool
Whether the magnifier is currently visible.
Sourcepub fn magnifier_exists(self: Handle<Self>, app: &App) -> bool
pub fn magnifier_exists(self: Handle<Self>, app: &App) -> bool
Whether the magnifier currently exists in the overlay.
Sourcepub fn spell_check_toolbar_is_visible(self: Handle<Self>, app: &App) -> bool
pub fn spell_check_toolbar_is_visible(self: Handle<Self>, app: &App) -> bool
Whether the spell check menu is currently visible.
Sourcepub fn hide(self: Handle<Self>, app: &mut App)
pub fn hide(self: Handle<Self>, app: &mut App)
Hides the entire overlay including the toolbar and the handles.
Sourcepub fn hide_toolbar(self: Handle<Self>, app: &mut App)
pub fn hide_toolbar(self: Handle<Self>, app: &mut App)
Hides the toolbar part of the overlay.