pub struct AutocompleteHighlightedOption {
pub key: Option<KeyRef>,
pub notifier: Ref<ValueNotifier<usize>>,
pub child: WidgetRef,
}Expand description
An inherited widget used to indicate which autocomplete option should be highlighted for keyboard navigation.
The RawAutocomplete widget will wrap the options view generated by the
options_view_builder with this widget to provide the highlighted option’s index to the
builder.
In the builder callback the index of the highlighted option can be obtained by using the
associated function of:
let highlighted_index = AutocompleteHighlightedOption::of(app, context);which can then be used to tell which option should be given a visual indication that will be the option selected with the keyboard.
Both InheritedWidget and InheritedNotifier offer an IntoWidget kind, so this
widget names the conversion itself (into_widget).
Fields§
§key: Option<KeyRef>See InheritedWidget::key.
notifier: Ref<ValueNotifier<usize>>Dart’s InheritedNotifier.notifier: the highlighted option’s index.
child: WidgetRefImplementations§
Source§impl AutocompleteHighlightedOption
impl AutocompleteHighlightedOption
Sourcepub fn new<K>(
highlight_index_notifier: Ref<ValueNotifier<usize>>,
child: impl IntoWidget<K>,
) -> AutocompleteHighlightedOption
pub fn new<K>( highlight_index_notifier: Ref<ValueNotifier<usize>>, child: impl IntoWidget<K>, ) -> AutocompleteHighlightedOption
Create an instance of AutocompleteHighlightedOption inherited widget.
Sourcepub fn key(self, key: KeyRef) -> AutocompleteHighlightedOption
pub fn key(self, key: KeyRef) -> AutocompleteHighlightedOption
Dart AutocompleteHighlightedOption(key:).
Sourcepub fn into_widget(self) -> WidgetRef
pub fn into_widget(self) -> WidgetRef
The tree node, as an InheritedNotifier.
Sourcepub fn of(app: &mut App, context: BuildContext) -> usize
pub fn of(app: &mut App, context: BuildContext) -> usize
Returns the index of the highlighted option from the closest
AutocompleteHighlightedOption ancestor.
If there is no ancestor, it returns 0.
Trait Implementations§
Source§impl InheritedNotifier for AutocompleteHighlightedOption
impl InheritedNotifier for AutocompleteHighlightedOption
Source§type Notifier = ValueNotifier<usize>
type Notifier = ValueNotifier<usize>
T extends Listenable.Source§fn notifier(&self) -> Option<Handle<ValueNotifier<usize>>>
fn notifier(&self) -> Option<Handle<ValueNotifier<usize>>>
Listenable object to which to listen. Read moreSource§impl InheritedWidget for AutocompleteHighlightedOption
impl InheritedWidget for AutocompleteHighlightedOption
Source§fn update_should_notify(&self, old_widget: &Self) -> bool
fn update_should_notify(&self, old_widget: &Self) -> bool
Source§fn debug_fill_properties(
&self,
_app: &App,
properties: &mut DiagnosticPropertiesBuilder,
)
fn debug_fill_properties( &self, _app: &App, properties: &mut DiagnosticPropertiesBuilder, )
debugFillProperties: the properties a dump shows for this widget, in Dart’s
order. Dart’s Widget base only sets the dense tree style, which the framework does.Source§fn as_inherited_theme(&self) -> Option<&dyn InheritedTheme>
fn as_inherited_theme(&self) -> Option<&dyn InheritedTheme>
this is InheritedTheme: an inherited widget that is an InheritedTheme
answers with itself, which is what InheritedTheme::capture collects.Auto Trait Implementations§
impl !RefUnwindSafe for AutocompleteHighlightedOption
impl !Send for AutocompleteHighlightedOption
impl !Sync for AutocompleteHighlightedOption
impl !UnwindSafe for AutocompleteHighlightedOption
impl Forget for AutocompleteHighlightedOption
impl Freeze for AutocompleteHighlightedOptionwhere
*const RcInner<dyn Key> is !null: Freeze,
PhantomData<RcInner<dyn Key>>: Freeze,
NonZero<u32>: Freeze,
PhantomData<fn() -> ValueNotifier<usize>>: Freeze,
*const RcInner<Keep> is !null: Freeze,
PhantomData<RcInner<Keep>>: Freeze,
*const RcInner<dyn Widget> is !null: Freeze,
PhantomData<RcInner<dyn Widget>>: Freeze,
impl Move for AutocompleteHighlightedOption
impl Unpin for AutocompleteHighlightedOption
impl UnsafeUnpin for AutocompleteHighlightedOptionwhere
*const RcInner<dyn Key> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Key>>: UnsafeUnpin,
NonZeroU32Inner: UnsafeUnpin,
PhantomData<fn() -> ValueNotifier<usize>>: UnsafeUnpin,
*const RcInner<Keep> is !null: UnsafeUnpin,
PhantomData<RcInner<Keep>>: UnsafeUnpin,
*const RcInner<dyn Widget> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Widget>>: UnsafeUnpin,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<W> IntoWidget<InheritedKind> for Wwhere
W: InheritedWidget,
impl<W> IntoWidget<InheritedKind> for Wwhere
W: InheritedWidget,
Source§fn into_widget(self) -> Rc<dyn Widget>
fn into_widget(self) -> Rc<dyn Widget>
creation_location.Source§impl<W> IntoWidget<InheritedNotifierKind> for Wwhere
W: InheritedNotifier,
impl<W> IntoWidget<InheritedNotifierKind> for Wwhere
W: InheritedNotifier,
Source§fn into_widget(self) -> Rc<dyn Widget>
fn into_widget(self) -> Rc<dyn Widget>
creation_location.