pub struct InkDecoration { /* private fields */ }Expand description
A decoration on a part of a Material.
This object is rarely created directly. Instead of creating an ink
decoration directly, consider using an Ink widget, which uses this class
in combination with Padding and ConstrainedBox to draw a decoration on a
Material.
See also:
Ink, the corresponding widget.InkResponse, which uses gestures to trigger ink highlights and ink splashes in the parentMaterial.InkWell, which is a rectangularInkResponse(the most common type of ink response).Material, which is the widget on which the ink is painted.
Implementations§
Source§impl InkDecoration
impl InkDecoration
Sourcepub fn new(
app: &mut App,
decoration: Option<DecorationRef>,
is_visible: bool,
configuration: ImageConfiguration,
controller: AnyMaterialInkController,
reference_box: AnyRenderBox,
on_removed: Option<Listener>,
) -> Ref<InkDecoration>
pub fn new( app: &mut App, decoration: Option<DecorationRef>, is_visible: bool, configuration: ImageConfiguration, controller: AnyMaterialInkController, reference_box: AnyRenderBox, on_removed: Option<Listener>, ) -> Ref<InkDecoration>
Draws a decoration on a Material.
Dart’s default is_visible is true.
Sourcepub fn decoration(self: Handle<Self>, app: &App) -> Option<&DecorationRef>
pub fn decoration(self: Handle<Self>, app: &App) -> Option<&DecorationRef>
Sourcepub fn set_decoration(
self: Handle<Self>,
app: &mut App,
value: Option<DecorationRef>,
)
pub fn set_decoration( self: Handle<Self>, app: &mut App, value: Option<DecorationRef>, )
Sets decoration.
Sourcepub fn is_visible(self: Handle<Self>, app: &App) -> bool
pub fn is_visible(self: Handle<Self>, app: &App) -> bool
Whether the decoration should be painted.
Defaults to true.
Sourcepub fn set_is_visible(self: Handle<Self>, app: &mut App, value: bool)
pub fn set_is_visible(self: Handle<Self>, app: &mut App, value: bool)
Sets is_visible.
Sourcepub fn configuration(self: Handle<Self>, app: &App) -> &ImageConfiguration
pub fn configuration(self: Handle<Self>, app: &App) -> &ImageConfiguration
The configuration to pass to the BoxPainter obtained from the
decoration, when painting.
The ImageConfiguration::size field is ignored (and replaced by the size
of the reference_box, at paint time).
Sourcepub fn set_configuration(
self: Handle<Self>,
app: &mut App,
value: ImageConfiguration,
)
pub fn set_configuration( self: Handle<Self>, app: &mut App, value: ImageConfiguration, )
Sets configuration.
Trait Implementations§
Source§impl InkFeatureLeaf for InkDecoration
impl InkFeatureLeaf for InkDecoration
Source§impl InkFeatureLeafData for InkDecoration
impl InkFeatureLeafData for InkDecoration
Source§fn ink_feature(&self) -> &InkFeatureData
fn ink_feature(&self) -> &InkFeatureData
The leaf’s
InkFeature bag.Source§fn ink_feature_mut(&mut self) -> &mut InkFeatureData
fn ink_feature_mut(&mut self) -> &mut InkFeatureData
The leaf’s
InkFeature bag, mutably.Auto Trait Implementations§
impl !RefUnwindSafe for InkDecoration
impl !Send for InkDecoration
impl !Sync for InkDecoration
impl !UnwindSafe for InkDecoration
impl Forget for InkDecoration
impl Freeze for InkDecorationwhere
NonZero<u32>: Freeze,
PhantomData<fn() -> RenderInkFeatures>: Freeze,
&'static RenderBoxVTable: Freeze,
*const RcInner<dyn Fn(&mut App)> is !null: Freeze,
PhantomData<RcInner<dyn Fn(&mut App)>>: Freeze,
*const (): Freeze,
*const dyn BoxPainter is !null: Freeze,
PhantomData<dyn BoxPainter>: Freeze,
*const RcInner<dyn Decoration> is !null: Freeze,
PhantomData<RcInner<dyn Decoration>>: Freeze,
*const RcInner<dyn AssetBundle> is !null: Freeze,
PhantomData<RcInner<dyn AssetBundle>>: Freeze,
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
impl Move for InkDecoration
impl Unpin for InkDecoration
impl UnsafeUnpin for InkDecorationwhere
NonZeroU32Inner: UnsafeUnpin,
PhantomData<fn() -> RenderInkFeatures>: UnsafeUnpin,
&'static RenderBoxVTable: UnsafeUnpin,
*const RcInner<dyn Fn(&mut App)> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Fn(&mut App)>>: UnsafeUnpin,
*const (): UnsafeUnpin,
*const dyn BoxPainter is !null: UnsafeUnpin,
PhantomData<dyn BoxPainter>: UnsafeUnpin,
*const RcInner<dyn Decoration> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Decoration>>: UnsafeUnpin,
*const RcInner<dyn AssetBundle> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn AssetBundle>>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: 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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<F> InkFeatureObject for Fwhere
F: InkFeatureLeaf,
impl<F> InkFeatureObject for Fwhere
F: InkFeatureLeaf,
Source§fn as_ink_feature(self: Handle<F>) -> AnyInkFeature
fn as_ink_feature(self: Handle<F>) -> AnyInkFeature
This feature as the erased
AnyInkFeature — what to pass where a Dart API takes an
InkFeature.