pub struct SelectionArea {
pub key: Option<KeyRef>,
pub magnifier_configuration: Option<TextMagnifierConfiguration>,
pub focus_node: Option<FocusNodeRef>,
pub selection_controls: Option<Rc<dyn TextSelectionControls>>,
pub context_menu_builder: Option<SelectableRegionContextMenuBuilder>,
pub on_selection_changed: Option<ValueChanged<Option<SelectedContent>>>,
pub child: WidgetRef,
}Expand description
A widget that introduces an area for user selections with adaptive selection controls.
It is a SelectableRegion whose controls and context menu follow the ambient
Theme’s platform.
Fields§
§key: Option<KeyRef>See Widget::key.
magnifier_configuration: Option<TextMagnifierConfiguration>The configuration for the magnifier in the selection region.
focus_node: Option<FocusNodeRef>The focus node of the region the area builds.
selection_controls: Option<Rc<dyn TextSelectionControls>>The delegate that builds the selection handles and toolbar; one of the platform’s own
when None.
Builds the context menu; None shows none.
on_selection_changed: Option<ValueChanged<Option<SelectedContent>>>Called when the selected content changes.
child: WidgetRefThe child widget this selection area applies to.
Implementations§
Source§impl SelectionArea
impl SelectionArea
Sourcepub fn new<K>(child: impl IntoWidget<K>) -> SelectionArea
pub fn new<K>(child: impl IntoWidget<K>) -> SelectionArea
Creates a selection area over child.
Sourcepub fn key(self, key: KeyRef) -> SelectionArea
pub fn key(self, key: KeyRef) -> SelectionArea
Dart SelectionArea(key:).
Sourcepub fn focus_node(self, focus_node: FocusNodeRef) -> SelectionArea
pub fn focus_node(self, focus_node: FocusNodeRef) -> SelectionArea
Dart SelectionArea(focusNode:).
Sourcepub fn selection_controls(
self,
selection_controls: Rc<dyn TextSelectionControls>,
) -> SelectionArea
pub fn selection_controls( self, selection_controls: Rc<dyn TextSelectionControls>, ) -> SelectionArea
Dart SelectionArea(selectionControls:).
Dart SelectionArea(contextMenuBuilder:).
Sourcepub fn magnifier_configuration(
self,
magnifier_configuration: TextMagnifierConfiguration,
) -> SelectionArea
pub fn magnifier_configuration( self, magnifier_configuration: TextMagnifierConfiguration, ) -> SelectionArea
Dart SelectionArea(magnifierConfiguration:).
Sourcepub fn on_selection_changed(
self,
on_selection_changed: ValueChanged<Option<SelectedContent>>,
) -> SelectionArea
pub fn on_selection_changed( self, on_selection_changed: ValueChanged<Option<SelectedContent>>, ) -> SelectionArea
Dart SelectionArea(onSelectionChanged:).
Trait Implementations§
Source§impl Debug for SelectionArea
impl Debug for SelectionArea
Source§impl StatefulWidget for SelectionArea
impl StatefulWidget for SelectionArea
Source§type State = SelectionAreaState
type State = SelectionAreaState
Source§fn create_state(&self) -> SelectionAreaState
fn create_state(&self) -> SelectionAreaState
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 SelectionArea
impl !Send for SelectionArea
impl !Sync for SelectionArea
impl !UnwindSafe for SelectionArea
impl Forget for SelectionArea
impl Freeze for SelectionAreawhere
*const RcInner<dyn Key> is !null: Freeze,
PhantomData<RcInner<dyn Key>>: Freeze,
*const RcInner<dyn Fn(&mut App, AnyElement, Retained<Handle<MagnifierController>>, Retained<Handle<ValueNotifier<MagnifierInfo>>>) -> Option<Rc<dyn Widget>>> is !null: Freeze,
PhantomData<RcInner<dyn Fn(&mut App, AnyElement, Retained<Handle<MagnifierController>>, Retained<Handle<ValueNotifier<MagnifierInfo>>>) -> Option<Rc<dyn Widget>>>>: Freeze,
NonZero<u32>: Freeze,
&'static FocusNodeVTable: Freeze,
*const RcInner<Keep> is !null: Freeze,
PhantomData<RcInner<Keep>>: Freeze,
*const RcInner<dyn TextSelectionControls> is !null: Freeze,
PhantomData<RcInner<dyn TextSelectionControls>>: Freeze,
*const RcInner<dyn Fn(&mut App, AnyElement, Handle<SelectableRegionState>) -> Rc<dyn Widget>> is !null: Freeze,
PhantomData<RcInner<dyn Fn(&mut App, AnyElement, Handle<SelectableRegionState>) -> Rc<dyn Widget>>>: Freeze,
*const RcInner<dyn Fn(&mut App, Option<SelectedContent>)> is !null: Freeze,
PhantomData<RcInner<dyn Fn(&mut App, Option<SelectedContent>)>>: Freeze,
*const RcInner<dyn Widget> is !null: Freeze,
PhantomData<RcInner<dyn Widget>>: Freeze,
impl Move for SelectionArea
impl Unpin for SelectionAreawhere
Rc<dyn Key>: Unpin,
Rc<dyn Fn(&mut App, AnyElement, Retained<Handle<MagnifierController>>, Retained<Handle<ValueNotifier<MagnifierInfo>>>) -> Option<Rc<dyn Widget>>>: Unpin,
NonZero<u32>: Unpin,
&'static FocusNodeVTable: Unpin,
Rc<Keep>: Unpin,
Rc<dyn TextSelectionControls>: Unpin,
Rc<dyn Fn(&mut App, AnyElement, Handle<SelectableRegionState>) -> Rc<dyn Widget>>: Unpin,
Rc<dyn Fn(&mut App, Option<SelectedContent>)>: Unpin,
Rc<dyn Widget>: Unpin,
impl UnsafeUnpin for SelectionAreawhere
*const RcInner<dyn Key> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Key>>: UnsafeUnpin,
*const RcInner<dyn Fn(&mut App, AnyElement, Retained<Handle<MagnifierController>>, Retained<Handle<ValueNotifier<MagnifierInfo>>>) -> Option<Rc<dyn Widget>>> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Fn(&mut App, AnyElement, Retained<Handle<MagnifierController>>, Retained<Handle<ValueNotifier<MagnifierInfo>>>) -> Option<Rc<dyn Widget>>>>: UnsafeUnpin,
NonZeroU32Inner: UnsafeUnpin,
&'static FocusNodeVTable: UnsafeUnpin,
*const RcInner<Keep> is !null: UnsafeUnpin,
PhantomData<RcInner<Keep>>: UnsafeUnpin,
*const RcInner<dyn TextSelectionControls> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn TextSelectionControls>>: UnsafeUnpin,
*const RcInner<dyn Fn(&mut App, AnyElement, Handle<SelectableRegionState>) -> Rc<dyn Widget>> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Fn(&mut App, AnyElement, Handle<SelectableRegionState>) -> Rc<dyn Widget>>>: UnsafeUnpin,
*const RcInner<dyn Fn(&mut App, Option<SelectedContent>)> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Fn(&mut App, Option<SelectedContent>)>>: 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.