pub struct TextSelectionToolbar {
pub key: Option<KeyRef>,
pub anchor_above: Offset,
pub anchor_below: Offset,
pub children: Vec<WidgetRef>,
pub toolbar_builder: ToolbarBuilder,
}Expand description
A fully-functional Material-style text selection toolbar.
Tries to position itself above anchor_above, but if it doesn’t fit,
then it positions itself below anchor_below.
If any children don’t fit in the menu, an overflow menu will automatically be created.
See also:
AdaptiveTextSelectionToolbar, which builds the toolbar for the current platform.CupertinoTextSelectionToolbar, which is similar, but builds an iOS- style toolbar.
Fields§
§key: Option<KeyRef>§anchor_above: OffsetThe focal point above which the toolbar attempts to position itself.
If there is not enough room above before reaching the top of the screen,
then the toolbar will position itself below
anchor_below.
anchor_below: OffsetThe focal point below which the toolbar attempts to position itself, if
it doesn’t fit above anchor_above.
children: Vec<WidgetRef>The children that will be displayed in the text selection toolbar.
Typically these are buttons.
Must not be empty.
See also:
TextSelectionToolbarTextButton, which builds a default Material- style text selection toolbar text button.
toolbar_builder: ToolbarBuilderBuilds the toolbar container.
Useful for customizing the high-level background of the toolbar. The given child Widget will contain all of the children.
Implementations§
Source§impl TextSelectionToolbar
impl TextSelectionToolbar
Sourcepub const K_HANDLE_SIZE: f64 = 22.0
pub const K_HANDLE_SIZE: f64 = 22.0
The size of the text selection handles.
See also:
SpellCheckSuggestionsToolbar, which references this value to calculate the padding between the toolbar and anchor.
Sourcepub const K_TOOLBAR_CONTENT_DISTANCE_BELOW: f64
pub const K_TOOLBAR_CONTENT_DISTANCE_BELOW: f64
Padding between the toolbar and the anchor.
Sourcepub fn new(
anchor_above: Offset,
anchor_below: Offset,
children: impl IntoIterator<Item = WidgetRef>,
) -> TextSelectionToolbar
pub fn new( anchor_above: Offset, anchor_below: Offset, children: impl IntoIterator<Item = WidgetRef>, ) -> TextSelectionToolbar
Creates an instance of TextSelectionToolbar.
Sourcepub fn key(self, key: KeyRef) -> TextSelectionToolbar
pub fn key(self, key: KeyRef) -> TextSelectionToolbar
Dart TextSelectionToolbar(key:).
Sourcepub fn toolbar_builder(
self,
toolbar_builder: ToolbarBuilder,
) -> TextSelectionToolbar
pub fn toolbar_builder( self, toolbar_builder: ToolbarBuilder, ) -> TextSelectionToolbar
Dart TextSelectionToolbar(toolbarBuilder:).
Trait Implementations§
Source§impl Debug for TextSelectionToolbar
impl Debug for TextSelectionToolbar
Source§impl StatelessWidget for TextSelectionToolbar
impl StatelessWidget for TextSelectionToolbar
Source§fn build(&self, app: &mut App, context: BuildContext) -> WidgetRef
fn build(&self, app: &mut App, context: BuildContext) -> WidgetRef
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 debug_check_constructor(&self)
fn debug_check_constructor(&self)
Source§fn as_preferred_size_widget(
&self,
) -> Option<&(dyn PreferredSizeWidget + 'static)>
fn as_preferred_size_widget( &self, ) -> Option<&(dyn PreferredSizeWidget + 'static)>
this is PreferredSizeWidget: a widget that implements PreferredSizeWidget
answers with itself, which is what a parent asking an erased child for its preferred
size reads.Auto Trait Implementations§
impl !RefUnwindSafe for TextSelectionToolbar
impl !Send for TextSelectionToolbar
impl !Sync for TextSelectionToolbar
impl !UnwindSafe for TextSelectionToolbar
impl Forget for TextSelectionToolbar
impl Freeze for TextSelectionToolbarwhere
*const RcInner<dyn Key> is !null: Freeze,
PhantomData<RcInner<dyn Key>>: Freeze,
*const u8 is !null: Freeze,
PhantomData<Rc<dyn Widget>>: Freeze,
*const RcInner<dyn Fn(&mut App, AnyElement, Rc<dyn Widget>) -> Rc<dyn Widget>> is !null: Freeze,
PhantomData<RcInner<dyn Fn(&mut App, AnyElement, Rc<dyn Widget>) -> Rc<dyn Widget>>>: Freeze,
impl Move for TextSelectionToolbar
impl Unpin for TextSelectionToolbar
impl UnsafeUnpin for TextSelectionToolbarwhere
*const RcInner<dyn Key> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Key>>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<Rc<dyn Widget>>: UnsafeUnpin,
*const RcInner<dyn Fn(&mut App, AnyElement, Rc<dyn Widget>) -> Rc<dyn Widget>> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Fn(&mut App, AnyElement, Rc<dyn Widget>) -> Rc<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<StatelessKind> for Wwhere
W: StatelessWidget,
impl<W> IntoWidget<StatelessKind> for Wwhere
W: StatelessWidget,
Source§fn into_widget(self) -> Rc<dyn Widget>
fn into_widget(self) -> Rc<dyn Widget>
creation_location.