Skip to main content

InkDecoration

Struct InkDecoration 

Source
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 parent Material.
  • InkWell, which is a rectangular InkResponse (the most common type of ink response).
  • Material, which is the widget on which the ink is painted.

Implementations§

Source§

impl InkDecoration

Source

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.

Source

pub fn decoration(self: Handle<Self>, app: &App) -> Option<&DecorationRef>

What to paint on the Material.

The decoration is painted at the position and size of the reference_box, on the Material that owns the controller.

Source

pub fn set_decoration( self: Handle<Self>, app: &mut App, value: Option<DecorationRef>, )

Sets decoration.

Source

pub fn is_visible(self: Handle<Self>, app: &App) -> bool

Whether the decoration should be painted.

Defaults to true.

Source

pub fn set_is_visible(self: Handle<Self>, app: &mut App, value: bool)

Sets is_visible.

Source

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).

Source

pub fn set_configuration( self: Handle<Self>, app: &mut App, value: ImageConfiguration, )

Trait Implementations§

Source§

impl InkFeatureLeaf for InkDecoration

Source§

fn dispose(self: Handle<Self>, app: &mut App)

Free up the resources associated with this ink feature. Read more
Source§

fn paint_feature( self: Handle<Self>, app: &mut App, canvas: &mut Canvas, transform: &Matrix4, )

Override this method to paint the ink feature. Read more
Source§

impl InkFeatureLeafData for InkDecoration

Source§

fn ink_feature(&self) -> &InkFeatureData

The leaf’s InkFeature bag.
Source§

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 InkDecoration
where 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
where NonZero<u32>: Unpin, &'static RenderBoxVTable: Unpin, Rc<dyn Fn(&mut App)>: Unpin, *const (): Unpin, Box<dyn BoxPainter>: Unpin, Rc<dyn Decoration>: Unpin, Rc<dyn AssetBundle>: Unpin, *const u8 is !null: Unpin,

§

impl UnsafeUnpin for InkDecoration
where 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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<F> InkFeatureObject for F
where F: InkFeatureLeaf,

Source§

fn as_ink_feature(self: Handle<F>) -> AnyInkFeature

This feature as the erased AnyInkFeature — what to pass where a Dart API takes an InkFeature.
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>