pub struct AutofillGroupState { /* private fields */ }Expand description
State associated with an AutofillGroup widget.
An AutofillGroupState can be used to register an AutofillClient when it
enters this AutofillGroup (for example, when an EditableText is mounted or
reparented onto the AutofillGroup’s subtree), and unregister an
AutofillClient when it exits (for example, when an EditableText gets
unmounted or reparented out of the AutofillGroup’s subtree).
The AutofillGroupState class also provides an AutofillScope::attach
method that can be called by TextInputClients that support autofill,
instead of TextInput::attach, to create a TextInputConnection to interact
with the platform’s text input system.
Typically obtained using AutofillGroup::of.
Implementations§
Source§impl AutofillGroupState
impl AutofillGroupState
Sourcepub fn register(self: Handle<Self>, app: &mut App, client: AnyAutofillClient)
pub fn register(self: Handle<Self>, app: &mut App, client: AnyAutofillClient)
Adds the AutofillClient to this AutofillGroup.
Typically, this is called by TextInputClients that support autofill (for
example, EditableTextState) in State::did_change_dependencies, when the
input field should be registered to a new AutofillGroup.
See also:
EditableTextState.didChangeDependencies, where this method is called to update the currentAutofillScopewhen needed.
Sourcepub fn unregister(self: Handle<Self>, app: &mut App, autofill_id: &str)
pub fn unregister(self: Handle<Self>, app: &mut App, autofill_id: &str)
Removes an AutofillClient with the given autofill_id from this
AutofillGroup.
Typically, this should be called by a text field when it’s being disposed,
or before it’s registered with a different AutofillGroup.
See also:
EditableTextState.didChangeDependencies, where this method is called to unregister from the previousAutofillScope.EditableTextState.dispose, where this method is called to unregister from the currentAutofillScopewhen the widget is about to be removed from the tree.
Trait Implementations§
Source§impl AutofillScope for AutofillGroupState
impl AutofillScope for AutofillGroupState
Source§fn get_autofill_client(
self: Handle<Self>,
app: &App,
autofill_id: &str,
) -> Option<AnyAutofillClient>
fn get_autofill_client( self: Handle<Self>, app: &App, autofill_id: &str, ) -> Option<AnyAutofillClient>
Source§fn autofill_clients(self: Handle<Self>, app: &App) -> Vec<AnyAutofillClient>
fn autofill_clients(self: Handle<Self>, app: &App) -> Vec<AnyAutofillClient>
Source§fn attach(
self: Handle<Self>,
app: &mut App,
trigger: AnyTextInputClient,
configuration: TextInputConfiguration,
) -> Retained<Handle<TextInputConnection>>
fn attach( self: Handle<Self>, app: &mut App, trigger: AnyTextInputClient, configuration: TextInputConfiguration, ) -> Retained<Handle<TextInputConnection>>
TextInputClient to attach to this scope. This method should be
called in lieu of TextInput::attach, when the TextInputClient wishes to
participate in autofill. Read moreSource§impl State for AutofillGroupState
impl State for AutofillGroupState
Source§type Widget = AutofillGroup
type Widget = AutofillGroup
State<T> type argument.Source§fn state_data(self: Handle<Self>, app: &App) -> &StateData<Self::Widget>
fn state_data(self: Handle<Self>, app: &App) -> &StateData<Self::Widget>
state
(state_accessors!).Source§fn state_data_mut(
self: Handle<Self>,
app: &mut App,
) -> &mut StateData<Self::Widget>
fn state_data_mut( self: Handle<Self>, app: &mut App, ) -> &mut StateData<Self::Widget>
state_data.Source§fn did_change_dependencies(self: Handle<Self>, app: &mut App)
fn did_change_dependencies(self: Handle<Self>, app: &mut App)
Source§fn build(self: Handle<Self>, app: &mut App, _context: BuildContext) -> WidgetRef
fn build(self: Handle<Self>, app: &mut App, _context: BuildContext) -> WidgetRef
Source§fn dispose(self: Handle<Self>, app: &mut App)
fn dispose(self: Handle<Self>, app: &mut App)
Source§fn widget(self: Handle<Self>, app: &App) -> &Self::Widget
fn widget(self: Handle<Self>, app: &App) -> &Self::Widget
Source§fn context(self: Handle<Self>, app: &App) -> BuildContext
fn context(self: Handle<Self>, app: &App) -> BuildContext
Source§fn init_state(self: Handle<Self>, app: &mut App)
fn init_state(self: Handle<Self>, app: &mut App)
Source§fn did_update_widget(
self: Handle<Self>,
app: &mut App,
old_widget: &Self::Widget,
)
fn did_update_widget( self: Handle<Self>, app: &mut App, old_widget: &Self::Widget, )
Source§fn set_state(self: Handle<Self>, app: &mut App, f: impl FnOnce(&mut Self))
fn set_state(self: Handle<Self>, app: &mut App, f: impl FnOnce(&mut Self))
Source§fn deactivate(self: Handle<Self>, app: &mut App)
fn deactivate(self: Handle<Self>, app: &mut App)
Source§fn activate(self: Handle<Self>, app: &mut App)
fn activate(self: Handle<Self>, app: &mut App)
deactivate. Read moreSource§fn debug_fill_properties(
self: Handle<Self>,
app: &App,
properties: &mut DiagnosticPropertiesBuilder,
)
fn debug_fill_properties( self: Handle<Self>, app: &App, properties: &mut DiagnosticPropertiesBuilder, )
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.