pub struct SelectionContainer {
pub key: Option<KeyRef>,
pub registrar: Option<Retained<AnySelectionRegistrar>>,
pub delegate: Option<Retained<AnySelectionContainerDelegate>>,
pub child: Rc<dyn Widget>,
}Expand description
A container that handles selection events for the selectables in its subtree.
Its state is a single selectable, and registers itself with the registrar
when one is given and with the registrar from the context otherwise. The selectables below it
are collected by delegate, which the state hosts as the subtree’s
SelectionRegistrar.
Fields§
§key: Option<KeyRef>§registrar: Option<Retained<AnySelectionRegistrar>>The registrar this container is registered to; the context’s when None.
delegate: Option<Retained<AnySelectionContainerDelegate>>The delegate for the events sent to this container; None disables selection.
child: Rc<dyn Widget>The widget below this widget in the tree.
Implementations§
Source§impl SelectionContainer
impl SelectionContainer
Sourcepub fn new<K>(
delegate: Retained<AnySelectionContainerDelegate>,
child: impl IntoWidget<K>,
) -> SelectionContainer
pub fn new<K>( delegate: Retained<AnySelectionContainerDelegate>, child: impl IntoWidget<K>, ) -> SelectionContainer
Creates a selection container for child that collects its selectables through
delegate.
Sourcepub fn disabled<K>(child: impl IntoWidget<K>) -> SelectionContainer
pub fn disabled<K>(child: impl IntoWidget<K>) -> SelectionContainer
Creates a selection container that disables selection for its subtree.
Sourcepub fn key(self, key: KeyRef) -> SelectionContainer
pub fn key(self, key: KeyRef) -> SelectionContainer
Dart SelectionContainer(key:).
Sourcepub fn registrar(
self,
registrar: Retained<AnySelectionRegistrar>,
) -> SelectionContainer
pub fn registrar( self, registrar: Retained<AnySelectionRegistrar>, ) -> SelectionContainer
Dart SelectionContainer(registrar:).
Sourcepub fn maybe_of(
app: &mut App,
context: AnyElement,
) -> Option<Retained<AnySelectionRegistrar>>
pub fn maybe_of( app: &mut App, context: AnyElement, ) -> Option<Retained<AnySelectionRegistrar>>
The immediate ancestor SelectionRegistrar of context, None when there is no
selection container above it or the immediate one is disabled.
Trait Implementations§
Source§impl Debug for SelectionContainer
impl Debug for SelectionContainer
Source§impl StatefulWidget for SelectionContainer
impl StatefulWidget for SelectionContainer
Source§type State = SelectionContainerState
type State = SelectionContainerState
Source§fn create_state(&self) -> SelectionContainerState
fn create_state(&self) -> SelectionContainerState
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_preferred_size_widget(
&self,
) -> Option<&(dyn PreferredSizeWidget + 'static)>
fn as_preferred_size_widget( &self, ) -> Option<&(dyn PreferredSizeWidget + 'static)>
Source§fn type_name(&self) -> &'static str
fn type_name(&self) -> &'static str
Widget::type_name. A stateful form another widget kind becomes (an animated or
status transition widget) names the widget it wraps.Auto Trait Implementations§
impl !RefUnwindSafe for SelectionContainer
impl !Send for SelectionContainer
impl !Sync for SelectionContainer
impl !UnwindSafe for SelectionContainer
impl Forget for SelectionContainer
impl Freeze for SelectionContainerwhere
*const RcInner<dyn Key> is !null: Freeze,
PhantomData<RcInner<dyn Key>>: Freeze,
NonZero<u32>: Freeze,
&'static SelectionRegistrarVTable: Freeze,
*const RcInner<Keep> is !null: Freeze,
PhantomData<RcInner<Keep>>: Freeze,
&'static SelectionContainerDelegateVTable: Freeze,
*const RcInner<dyn Widget> is !null: Freeze,
PhantomData<RcInner<dyn Widget>>: Freeze,
impl Move for SelectionContainer
impl Unpin for SelectionContainer
impl UnsafeUnpin for SelectionContainerwhere
*const RcInner<dyn Key> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Key>>: UnsafeUnpin,
NonZeroU32Inner: UnsafeUnpin,
&'static SelectionRegistrarVTable: UnsafeUnpin,
*const RcInner<Keep> is !null: UnsafeUnpin,
PhantomData<RcInner<Keep>>: UnsafeUnpin,
&'static SelectionContainerDelegateVTable: 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<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<W> IntoWidget<StatefulKind> for Wwhere
W: StatefulWidget,
impl<W> IntoWidget<StatefulKind> for Wwhere
W: StatefulWidget,
Source§fn into_widget(self) -> Rc<dyn Widget>
fn into_widget(self) -> Rc<dyn Widget>
creation_location.