Skip to main content

EditableTextState

Struct EditableTextState 

Source
pub struct EditableTextState { /* private fields */ }
Expand description

State for a EditableText.

Implementations§

Source§

impl EditableTextState

Source

pub fn clipboard_status( self: Handle<Self>, app: &App, ) -> Handle<ClipboardStatusNotifier>

Detects whether the clipboard can paste.

Source

pub fn render_editable( self: Handle<Self>, app: &App, ) -> RenderHandle<RenderEditable>

The RenderEditable this state created.

Source

pub fn get_glyph_heights(self: Handle<Self>, app: &mut App) -> (f64, f64)

Gets the line heights at the start and end of the selection.

Source

pub fn context_menu_anchors( self: Handle<Self>, app: &mut App, ) -> TextSelectionToolbarAnchors

Returns the anchor points for the default context menu.

Source

pub fn context_menu_button_items( self: Handle<Self>, app: &mut App, ) -> Vec<ContextMenuButtonItem>

Returns the ContextMenuButtonItems representing the buttons in this platform’s default selection menu for EditableText.

Source

pub fn look_up_selection( self: Handle<Self>, app: &mut App, _cause: SelectionChangedCause, )

Look up the current selection, as in the “Look Up” edit menu button on iOS.

Source

pub fn search_web_for_selection( self: Handle<Self>, app: &mut App, _cause: SelectionChangedCause, )

Launch a web search on the current selection.

Source

pub fn share_selection( self: Handle<Self>, app: &mut App, _cause: SelectionChangedCause, )

Launch the share interface for the current selection.

Source

pub fn button_items_for_toolbar_options( self: Handle<Self>, app: &mut App, ) -> Option<Vec<ContextMenuButtonItem>>

Returns the ContextMenuButtonItems for the given ToolbarOptions.

Source

pub fn spell_check_configuration( self: Handle<Self>, app: &App, ) -> SpellCheckConfiguration

Configuration that determines how spell check will be performed.

Source

pub fn spell_check_enabled(self: Handle<Self>, app: &App) -> bool

Whether or not spell check is enabled.

Source

pub fn current_autofill_scope( self: Handle<Self>, app: &App, ) -> Option<Handle<AutofillGroupState>>

The AutofillGroup this EditableText belongs to, if any.

Source

pub fn cursor_currently_visible(self: Handle<Self>, app: &App) -> bool

Whether the blinking cursor is actually visible at this precise moment.

The cursor blink interval (the amount of time the cursor is in the “on” state or the “off” state).

Source

pub fn request_keyboard(self: Handle<Self>, app: &mut App)

Express interest in interacting with the keyboard.

Source

pub fn selection_overlay( self: Handle<Self>, app: &App, ) -> Option<Handle<TextSelectionOverlay>>

The current status of the text selection handles.

Source

pub fn bring_into_view( self: Handle<Self>, app: &mut App, position: TextPosition, )

Brings the provided TextPosition into the visible area of the text input.

Source

pub fn show_toolbar(self: Handle<Self>, app: &mut App) -> bool

Shows the selection toolbar at the location of the current cursor.

Source

pub fn hide_toolbar(self: Handle<Self>, app: &mut App, hide_handles: bool)

Hides the text selection toolbar.

Source

pub fn toggle_toolbar(self: Handle<Self>, app: &mut App, hide_handles: bool)

Toggles the visibility of the toolbar.

Source

pub fn show_spell_check_suggestions_toolbar( self: Handle<Self>, app: &mut App, ) -> bool

Shows toolbar with spell check suggestions of misspelled words that are available for click-and-replace.

Source

pub fn show_magnifier( self: Handle<Self>, app: &mut App, position_to_show: Offset, )

Shows the magnifier at the position given by position_to_show, if no magnifier exists.

Source

pub fn hide_magnifier(self: Handle<Self>, app: &mut App)

Hides the magnifier.

Source

pub fn find_suggestion_span_at_cursor_index( self: Handle<Self>, app: &App, cursor_index: i32, ) -> Option<SuggestionSpan>

Finds specified SuggestionSpan that matches the provided index using binary search.

Source

pub fn begin_batch_edit(self: Handle<Self>, app: &mut App)

Begins a new batch edit.

Source

pub fn end_batch_edit(self: Handle<Self>, app: &mut App)

Ends the current batch edit started by the last call to begin_batch_edit.

Source

pub fn build_text_span( self: Handle<Self>, app: &mut App, context: BuildContext, ) -> TextSpan

Builds TextSpan from current editing value.

Trait Implementations§

Source§

impl AutofillClient for EditableTextState

Source§

fn autofill_id(self: Handle<Self>, _app: &App) -> String

The unique identifier of this AutofillClient. Read more
Source§

fn text_input_configuration( self: Handle<Self>, app: &App, ) -> TextInputConfiguration

Source§

fn autofill( self: Handle<Self>, app: &mut App, new_editing_value: TextEditingValue, )

Requests this AutofillClient update its TextEditingValue to the given value.
Source§

fn as_autofill_client(self: Handle<Self>) -> AnyAutofillClient

This client as the erased AnyAutofillClient.
Source§

impl AutomaticKeepAliveClientMixin for EditableTextState

Source§

fn automatic_keep_alive_client_data( self: Handle<Self>, app: &App, ) -> &AutomaticKeepAliveClientMixinData

Mixin field access.
Source§

fn automatic_keep_alive_client_data_mut( self: Handle<Self>, app: &mut App, ) -> &mut AutomaticKeepAliveClientMixinData

Source§

fn want_keep_alive(self: Handle<Self>, app: &App) -> bool

Whether the current instance should be kept alive. Read more
Source§

fn update_keep_alive(self: Handle<Self>, app: &mut App)

Ensures that any AutomaticKeepAlive ancestors are in a good state, by firing a KeepAliveNotification or triggering the KeepAliveHandle as appropriate.
Source§

fn init_state(self: Handle<Self>, app: &mut App)

The mixin’s part of State::init_state; the state calls it where Dart’s super.initState() would reach the mixin.
Source§

fn deactivate(self: Handle<Self>, app: &mut App)

The mixin’s part of State::deactivate; the state calls it where Dart’s super.deactivate() would reach the mixin.
Source§

fn build(self: Handle<Self>, app: &mut App) -> WidgetRef

The mixin’s part of State::build; the state calls it where Dart’s super.build would reach the mixin. The return value must be ignored.
Source§

impl Debug for EditableTextState

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl State for EditableTextState

Source§

type Widget = EditableText

The widget this state belongs to; Dart’s State<T> type argument.
Source§

fn state_data(self: Handle<Self>, app: &App) -> &StateData<Self::Widget>

The framework’s bookkeeping, held under the field state (state_accessors!).
Source§

fn state_data_mut( self: Handle<Self>, app: &mut App, ) -> &mut StateData<Self::Widget>

Source§

fn init_state(self: Handle<Self>, app: &mut App)

Called when this object is inserted into the tree. Read more
Source§

fn did_change_dependencies(self: Handle<Self>, app: &mut App)

Called when a dependency of this State object changes. Read more
Source§

fn did_update_widget( self: Handle<Self>, app: &mut App, old_widget: &EditableText, )

Called whenever the widget configuration changes. Read more
Source§

fn activate(self: Handle<Self>, app: &mut App)

Called when this object is reinserted into the tree after having been removed via deactivate. Read more
Source§

fn deactivate(self: Handle<Self>, app: &mut App)

Called when this object is removed from the tree. Read more
Source§

fn dispose(self: Handle<Self>, app: &mut App)

Called when this object is removed from the tree permanently. Read more
Source§

fn build(self: Handle<Self>, app: &mut App, context: BuildContext) -> WidgetRef

Describes the part of the user interface represented by this widget. Read more
Source§

fn widget(self: Handle<Self>, app: &App) -> &Self::Widget

The current configuration. Read more
Source§

fn context(self: Handle<Self>, app: &App) -> BuildContext

The location in the tree where this widget builds. Read more
Source§

fn mounted(self: Handle<Self>, app: &App) -> bool

Whether this State object is currently in a tree. Read more
Source§

fn set_state(self: Handle<Self>, app: &mut App, f: impl FnOnce(&mut Self))

Notify the framework that the internal state of this object has changed. Read more
Source§

fn debug_fill_properties( self: Handle<Self>, app: &App, properties: &mut DiagnosticPropertiesBuilder, )

Dart’s debugFillProperties: the properties this state shows where its element’s dump names it (state: ScrollableState#1a2b3(offset: 0.0)), after the lifecycle and mounting properties State’s base adds, which the framework adds first.
Source§

impl TextInputClient for EditableTextState

Source§

fn current_text_editing_value( self: Handle<Self>, app: &App, ) -> Option<TextEditingValue>

The current state of the TextEditingValue held by this client.
Source§

fn update_editing_value( self: Handle<Self>, app: &mut App, value: TextEditingValue, )

Requests that this client update its editing state to the given value. Read more
Source§

fn perform_action(self: Handle<Self>, app: &mut App, action: TextInputAction)

Requests that this client perform the given action.
Source§

fn perform_private_command(self: Handle<Self>, app: &mut App, action: &str)

Request from the input method that this client perform the given private command.
Source§

fn connection_closed(self: Handle<Self>, app: &mut App)

Platform notified framework of closed connection. Read more
Source§

fn show_autocorrection_prompt_rect( self: Handle<Self>, app: &mut App, start: i32, end: i32, )

Requests that this client display a prompt rectangle for the given text range, to indicate the range of text that will be changed by a pending autocorrection.
Source§

fn show_toolbar(self: Handle<Self>, app: &mut App)

Requests that the client show the editing toolbar, for example when the platform changes the selection through a non-flutter method such as scribble.
Source§

fn perform_selector(self: Handle<Self>, app: &mut App, selector_name: &str)

Performs the specified MacOS-specific selector from the NSStandardKeyBindingResponding protocol or user-specified selector from DefaultKeyBinding.Dict.
Source§

fn update_floating_cursor( self: Handle<Self>, app: &mut App, point: RawFloatingCursorPoint, )

Updates the floating cursor position and state.
Source§

fn insert_text_placeholder(self: Handle<Self>, app: &mut App, size: Size)

Requests that the client add a text placeholder to reserve visual space in the text.
Source§

fn remove_text_placeholder(self: Handle<Self>, app: &mut App)

Requests that the client remove the text placeholder.
Source§

fn as_text_input_client(self: Handle<Self>) -> AnyTextInputClient

This client as the erased AnyTextInputClient.
Source§

impl TextSelectionDelegate for EditableTextState

Source§

fn text_editing_value(self: Handle<Self>, app: &App) -> TextEditingValue

Gets the current text input.
Source§

fn user_update_text_editing_value( self: Handle<Self>, app: &mut App, value: TextEditingValue, cause: SelectionChangedCause, )

Indicates that the user has requested the delegate to replace its current text editing state with value. Read more
Source§

fn hide_toolbar(self: Handle<Self>, app: &mut App, hide_handles: bool)

Hides the text selection toolbar. Read more
Source§

fn bring_into_view(self: Handle<Self>, app: &mut App, position: TextPosition)

Brings the provided [TextPosition] into the visible area of the text input.
Source§

fn cut_enabled(self: Handle<Self>, app: &App) -> bool

Whether cut is enabled.
Source§

fn copy_enabled(self: Handle<Self>, app: &App) -> bool

Whether copy is enabled.
Source§

fn paste_enabled(self: Handle<Self>, app: &App) -> bool

Whether paste is enabled.
Source§

fn select_all_enabled(self: Handle<Self>, app: &App) -> bool

Whether select all is enabled.
Source§

fn look_up_enabled(self: Handle<Self>, app: &App) -> bool

Whether look up is enabled.
Source§

fn search_web_enabled(self: Handle<Self>, app: &App) -> bool

Whether search web is enabled.
Source§

fn share_enabled(self: Handle<Self>, app: &App) -> bool

Whether share is enabled.
Source§

fn live_text_input_enabled(self: Handle<Self>, app: &App) -> bool

Whether Live Text input is enabled.
Source§

fn copy_selection( self: Handle<Self>, app: &mut App, cause: SelectionChangedCause, )

Copy current selection to crate::Clipboard.
Source§

fn cut_selection( self: Handle<Self>, app: &mut App, cause: SelectionChangedCause, )

Cut current selection to crate::Clipboard.
Source§

fn paste_text( self: Handle<Self>, app: &mut App, cause: SelectionChangedCause, ) -> Task<()> ⓘ

Paste text from crate::Clipboard.
Source§

fn select_all(self: Handle<Self>, app: &mut App, cause: SelectionChangedCause)

Set the current selection to contain the entire text value.
Source§

fn as_text_selection_delegate(self: Handle<Self>) -> AnyTextSelectionDelegate

This delegate as the erased AnyTextSelectionDelegate.
Source§

impl TickerProviderObject for EditableTextState

Source§

impl TickerProviderStateMixin for EditableTextState

Source§

fn ticker_provider_data( self: Handle<Self>, app: &App, ) -> &TickerProviderStateMixinData

Mixin field access.
Source§

fn ticker_provider_data_mut( self: Handle<Self>, app: &mut App, ) -> &mut TickerProviderStateMixinData

Source§

fn debug_fill_properties( self: Handle<Self>, app: &App, properties: &mut DiagnosticPropertiesBuilder, )

Dart’s TickerProviderStateMixin.debugFillProperties, which a state’s own body calls where Dart’s mixin adds its line.
Source§

fn create_ticker( self: Handle<Self>, app: &mut App, on_tick: TickerCallback, ) -> Ref<Ticker>

TickerProvider::create_ticker: creates a ticker with the given callback.
Source§

fn activate(self: Handle<Self>, app: &mut App)

The mixin’s part of State::activate; the state calls it where Dart’s super.activate() would reach the mixin. A GlobalKey that moves the element to another view deactivates and activates it, so this is where the tickers follow it.
Source§

fn dispose(self: Handle<Self>, app: &mut App)

The mixin’s part of State::dispose; the state calls it where Dart’s super.dispose() would reach the mixin. Every vended ticker must already be disposed (by disposing its AnimationController).
Source§

impl WidgetsBindingObserverObject for EditableTextState

Source§

fn did_change_metrics(self: Handle<Self>, app: &mut App)

Source§

fn did_change_locales( self: Handle<Self>, app: &mut App, locales: Option<&[Locale]>, )

Source§

fn did_change_view_focus( self: Handle<Self>, app: &mut App, event: ViewFocusEvent, )

Source§

fn did_change_drag(self: Handle<Self>, app: &mut App, report: &DragReport)

Source§

fn did_change_text_scale_factor(self: Handle<Self>, app: &mut App)

Source§

fn did_change_platform_brightness(self: Handle<Self>, app: &mut App)

Source§

fn did_change_caption_style(self: Handle<Self>, app: &mut App)

Source§

fn did_change_app_lifecycle_state( self: Handle<Self>, app: &mut App, state: AppLifecycleState, )

Source§

fn did_request_app_exit( self: Handle<Self>, app: &mut App, ) -> Task<AppExitResponse> ⓘ

Source§

fn did_change_accessibility_features(self: Handle<Self>, app: &mut App)

Source§

fn did_pop_route(self: Handle<Self>, app: &mut App, view: ViewId) -> bool

Source§

fn handle_start_back_gesture( self: Handle<Self>, app: &mut App, back_event: PredictiveBackEvent, ) -> bool

Source§

fn handle_update_back_gesture_progress( self: Handle<Self>, app: &mut App, back_event: PredictiveBackEvent, )

Source§

fn handle_commit_back_gesture(self: Handle<Self>, app: &mut App)

Source§

fn handle_cancel_back_gesture(self: Handle<Self>, app: &mut App)

Source§

fn did_add_view(self: Handle<Self>, app: &mut App, view: &ViewRef)

Source§

fn did_remove_view(self: Handle<Self>, app: &mut App, view: ViewId)

Source§

fn did_fail_view_request( self: Handle<Self>, app: &mut App, request: RequestId, error: &ViewError, )

Source§

fn did_request_view_close( self: Handle<Self>, app: &mut App, view: ViewId, ) -> bool

Auto Trait Implementations§

§

impl !Freeze for EditableTextState

§

impl !RefUnwindSafe for EditableTextState

§

impl !Send for EditableTextState

§

impl !Sync for EditableTextState

§

impl !UnwindSafe for EditableTextState

§

impl Forget for EditableTextState

§

impl Move for EditableTextState

§

impl Unpin for EditableTextState

§

impl UnsafeUnpin for EditableTextState
where *const RcInner<dyn Widget> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Widget>>: UnsafeUnpin, NonZeroU32Inner: UnsafeUnpin, PhantomData<fn() -> StatefulElement>: UnsafeUnpin, PhantomData<fn() -> EditableText>: UnsafeUnpin, PhantomData<fn() -> KeepAliveHandle>: UnsafeUnpin, *const RcInner<Keep> is !null: UnsafeUnpin, PhantomData<RcInner<Keep>>: UnsafeUnpin, *const u8 is !null: UnsafeUnpin, PhantomData<(Retained<Handle<Ticker>>, ())>: UnsafeUnpin, *const RcInner<dyn ValueListenable<TickerModeData>> is !null: UnsafeUnpin, PhantomData<RcInner<dyn ValueListenable<TickerModeData>>>: UnsafeUnpin, PhantomData<fn() -> AnimationController>: UnsafeUnpin, PhantomData<fn() -> ValueNotifier<bool>>: UnsafeUnpin, PhantomData<fn() -> ClipboardStatusNotifier>: UnsafeUnpin, PhantomData<fn() -> LiveTextInputStatusNotifier>: UnsafeUnpin, PhantomData<fn() -> TextInputConnection>: UnsafeUnpin, *const RcInner<dyn Fn(&mut App, AnyLayer)> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Fn(&mut App, AnyLayer)>>: UnsafeUnpin, PhantomData<u8>: UnsafeUnpin, *const TextScaler is !null: UnsafeUnpin, PhantomData<TextScaler>: UnsafeUnpin, *const RcInner<dyn InlineSpan> is !null: UnsafeUnpin, PhantomData<RcInner<dyn InlineSpan>>: UnsafeUnpin, PhantomData<fn() -> ScrollController>: UnsafeUnpin, PhantomData<fn() -> LayerLink>: UnsafeUnpin, *const RcInner<dyn ProcessTextService> is !null: UnsafeUnpin, PhantomData<RcInner<dyn ProcessTextService>>: UnsafeUnpin, PhantomData<ProcessTextAction>: UnsafeUnpin, *const RcInner<dyn SpellCheckService> is !null: UnsafeUnpin, PhantomData<RcInner<dyn SpellCheckService>>: UnsafeUnpin, &'static dyn ColorExtension: UnsafeUnpin, *const RcInner<dyn ColorExtension> is !null: UnsafeUnpin, PhantomData<RcInner<dyn ColorExtension>>: UnsafeUnpin, PhantomData<String>: UnsafeUnpin, *const RcInner<Paint> is !null: UnsafeUnpin, PhantomData<RcInner<Paint>>: UnsafeUnpin, PhantomData<Shadow>: UnsafeUnpin, PhantomData<FontFeature>: UnsafeUnpin, PhantomData<FontVariation>: UnsafeUnpin, *const RcInner<dyn Fn(&mut App, AnyElement, Handle<EditableTextState>) -> Rc<dyn Widget>> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Fn(&mut App, AnyElement, Handle<EditableTextState>) -> Rc<dyn Widget>>>: UnsafeUnpin, PhantomData<SuggestionSpan>: UnsafeUnpin, PhantomData<fn() -> AutofillGroupState>: UnsafeUnpin, PhantomData<fn() -> AppLifecycleListener>: UnsafeUnpin, PhantomData<(TypeId, Retained<AnyAction>)>: UnsafeUnpin, PhantomData<fn() -> RenderEditable>: UnsafeUnpin, PhantomData<LineMetrics>: UnsafeUnpin, PhantomData<(i32, (Offset, TextPosition))>: UnsafeUnpin, *const RcInner<dyn Key> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Key>>: UnsafeUnpin, *const RcInner<dyn WidgetsBindingObserver> is !null: UnsafeUnpin, PhantomData<RcInner<dyn WidgetsBindingObserver>>: UnsafeUnpin, PhantomData<fn() -> TextSelectionOverlay>: UnsafeUnpin,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>