pub struct SelectionContainer {
pub key: Option<KeyRef>,
pub registrar: Option<SelectionRegistrarRef>,
pub delegate: Option<SelectionContainerDelegateRef>,
pub child: WidgetRef,
}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<SelectionRegistrarRef>The registrar this container is registered to; the context’s when None.
delegate: Option<SelectionContainerDelegateRef>The delegate for the events sent to this container; None disables selection.
child: WidgetRefThe widget below this widget in the tree.
Implementations§
Source§impl SelectionContainer
impl SelectionContainer
Sourcepub fn new<K>(
delegate: SelectionContainerDelegateRef,
child: impl IntoWidget<K>,
) -> Self
pub fn new<K>( delegate: SelectionContainerDelegateRef, child: impl IntoWidget<K>, ) -> Self
Creates a selection container for child that collects its selectables through
delegate.
Sourcepub fn disabled<K>(child: impl IntoWidget<K>) -> Self
pub fn disabled<K>(child: impl IntoWidget<K>) -> Self
Creates a selection container that disables selection for its subtree.
Sourcepub fn registrar(self, registrar: SelectionRegistrarRef) -> Self
pub fn registrar(self, registrar: SelectionRegistrarRef) -> Self
Dart SelectionContainer(registrar:).
Sourcepub fn maybe_of(
app: &mut App,
context: BuildContext,
) -> Option<SelectionRegistrarRef>
pub fn maybe_of( app: &mut App, context: BuildContext, ) -> Option<SelectionRegistrarRef>
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>
fn as_preferred_size_widget(&self) -> Option<&dyn PreferredSizeWidget>
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<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.