pub struct DefaultSelectionStyle {
pub key: Option<KeyRef>,
pub cursor_color: Option<AnyColor>,
pub selection_color: Option<AnyColor>,
pub mouse_cursor: Option<MouseCursorRef>,
pub child: WidgetRef,
}Expand description
The default cursor and selection color (semi-transparent grey) for the current platform.
The selection color is used by Text widgets in a SelectionArea and by editable text
widgets that read this style.
See also:
DefaultTextStyle, which provides the default text style.
Fields§
§key: Option<KeyRef>See InheritedWidget::key.
cursor_color: Option<AnyColor>The default cursor color.
selection_color: Option<AnyColor>The default selection color.
mouse_cursor: Option<MouseCursorRef>The MouseCursor for mouse pointers hovering over
selectable Text widgets.
If this property is None, SystemMouseCursors::text will be used.
child: WidgetRefThe widget below this widget in the tree.
Implementations§
Source§impl DefaultSelectionStyle
impl DefaultSelectionStyle
Sourcepub const DEFAULT_COLOR: Color
pub const DEFAULT_COLOR: Color
The default color.
Sourcepub fn new<K>(child: impl IntoWidget<K>) -> DefaultSelectionStyle
pub fn new<K>(child: impl IntoWidget<K>) -> DefaultSelectionStyle
Creates a default selection style widget that specifies the selection properties for all widgets below it in the widget tree; Dart’s optional named arguments are the setters.
Sourcepub fn fallback() -> DefaultSelectionStyle
pub fn fallback() -> DefaultSelectionStyle
A const-constructable default selection style that provides fallback values
(None).
Returned from of when the given BuildContext doesn’t have an
enclosing default selection style.
This constructor creates a DefaultSelectionStyle with an invalid child, which
means the constructed value cannot be incorporated into the tree.
Sourcepub fn key(self, key: KeyRef) -> DefaultSelectionStyle
pub fn key(self, key: KeyRef) -> DefaultSelectionStyle
Dart DefaultSelectionStyle(key:).
Sourcepub fn cursor_color(
self,
cursor_color: impl Into<AnyColor>,
) -> DefaultSelectionStyle
pub fn cursor_color( self, cursor_color: impl Into<AnyColor>, ) -> DefaultSelectionStyle
Dart DefaultSelectionStyle(cursorColor:).
Sourcepub fn selection_color(
self,
selection_color: impl Into<AnyColor>,
) -> DefaultSelectionStyle
pub fn selection_color( self, selection_color: impl Into<AnyColor>, ) -> DefaultSelectionStyle
Dart DefaultSelectionStyle(selectionColor:).
Sourcepub fn mouse_cursor(self, mouse_cursor: MouseCursorRef) -> DefaultSelectionStyle
pub fn mouse_cursor(self, mouse_cursor: MouseCursorRef) -> DefaultSelectionStyle
Dart DefaultSelectionStyle(mouseCursor:).
Sourcepub fn merge<K>(child: impl IntoWidget<K>) -> DefaultSelectionStyleMerge
pub fn merge<K>(child: impl IntoWidget<K>) -> DefaultSelectionStyleMerge
Creates a default selection style that overrides the selection styles in scope at this point in the widget tree.
Any arguments that are not None replace the corresponding properties on the
ambient default selection style. Dart’s optional named arguments are the setters of
the DefaultSelectionStyleMerge this returns.
Sourcepub fn of(app: &mut App, context: BuildContext) -> DefaultSelectionStyle
pub fn of(app: &mut App, context: BuildContext) -> DefaultSelectionStyle
The closest instance of this class that encloses the given context.
If no such instance exists, this method will return
fallback.
Trait Implementations§
Source§impl Debug for DefaultSelectionStyle
impl Debug for DefaultSelectionStyle
Source§impl InheritedWidget for DefaultSelectionStyle
impl InheritedWidget for DefaultSelectionStyle
Source§fn update_should_notify(&self, old_widget: &DefaultSelectionStyle) -> bool
fn update_should_notify(&self, old_widget: &DefaultSelectionStyle) -> bool
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.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.Auto Trait Implementations§
impl !RefUnwindSafe for DefaultSelectionStyle
impl !Send for DefaultSelectionStyle
impl !Sync for DefaultSelectionStyle
impl !UnwindSafe for DefaultSelectionStyle
impl Forget for DefaultSelectionStyle
impl Freeze for DefaultSelectionStylewhere
*const RcInner<dyn Key> is !null: Freeze,
PhantomData<RcInner<dyn Key>>: Freeze,
&'static dyn ColorExtension: Freeze,
*const RcInner<dyn ColorExtension> is !null: Freeze,
PhantomData<RcInner<dyn ColorExtension>>: Freeze,
*const RcInner<dyn MouseCursor> is !null: Freeze,
PhantomData<RcInner<dyn MouseCursor>>: Freeze,
*const RcInner<dyn Widget> is !null: Freeze,
PhantomData<RcInner<dyn Widget>>: Freeze,
impl Move for DefaultSelectionStyle
impl Unpin for DefaultSelectionStylewhere
Rc<dyn Key>: Unpin,
&'static dyn ColorExtension: Unpin,
Rc<dyn ColorExtension>: Unpin,
Rc<dyn MouseCursor>: Unpin,
Rc<dyn Widget>: Unpin,
impl UnsafeUnpin for DefaultSelectionStylewhere
*const RcInner<dyn Key> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Key>>: UnsafeUnpin,
&'static dyn ColorExtension: UnsafeUnpin,
*const RcInner<dyn ColorExtension> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn ColorExtension>>: UnsafeUnpin,
*const RcInner<dyn MouseCursor> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn MouseCursor>>: 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.