Skip to main content

InkRipple

Struct InkRipple 

Source
pub struct InkRipple { /* private fields */ }
Expand description

A visual reaction on a piece of Material to user input.

A circular ink feature whose origin starts at the input touch point and whose radius expands from 60% of the final radius. The splash origin animates to the center of its reference_box.

This object is rarely created directly. Instead of creating an ink ripple, consider using an InkResponse or InkWell widget, which uses gestures (such as tap and long-press) to trigger ink splashes. This class is used when the ThemeData’s splash factory is InkRipple::splash_factory.

See also:

  • InkSplash, which is an ink splash feature that expands less aggressively than the ripple.
  • 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 splash is painted.
  • InkHighlight, which is an ink feature that emphasizes a part of a Material.

Implementations§

Source§

impl InkRipple

Source

pub fn new( app: &mut App, controller: AnyMaterialInkController, reference_box: AnyRenderBox, position: Offset, color: Color, text_direction: TextDirection, contained_ink_well: bool, rect_callback: Option<RectCallback>, border_radius: Option<BorderRadius>, custom_border: Option<ShapeBorderRef>, radius: Option<f64>, on_removed: Option<Listener>, ) -> Ref<InkRipple>

Begin a ripple, centered at position relative to reference_box.

The controller argument is typically obtained via Material::of(app, context).

If contained_ink_well is true, then the ripple will be sized to fit the well rectangle, then clipped to it when drawn. The well rectangle is the box returned by rect_callback, if provided, or otherwise is the bounds of the reference_box.

If contained_ink_well is false, then rect_callback should be null. The ink ripple is clipped only to the edges of the Material. This is the default.

When the ripple is removed, on_removed will be called.

Source

pub fn splash_factory() -> InteractiveInkFeatureFactoryRef

Used to specify this type of ink splash for an InkWell, InkResponse, material Theme, or ButtonStyle.

Dart’s static const: every call hands out the same factory, so they compare equal.

Trait Implementations§

Source§

impl InkFeatureLeaf for InkRipple

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 InkRipple

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.
Source§

impl InteractiveInkFeatureLeaf for InkRipple

Source§

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

Called when the user input that triggered this feature’s appearance was confirmed. Read more
Source§

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

Called when the user input that triggered this feature’s appearance was canceled. Read more
Source§

impl InteractiveInkFeatureLeafData for InkRipple

Auto Trait Implementations§

§

impl !RefUnwindSafe for InkRipple

§

impl !Send for InkRipple

§

impl !Sync for InkRipple

§

impl !UnwindSafe for InkRipple

§

impl Forget for InkRipple

§

impl Freeze for InkRipple
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 RcInner<dyn ShapeBorder> is !null: Freeze, PhantomData<RcInner<dyn ShapeBorder>>: Freeze, *const RcInner<dyn Fn(&App) -> Rect> is !null: Freeze, PhantomData<RcInner<dyn Fn(&App) -> Rect>>: Freeze, &'static AnimationVTable<f64>: Freeze, *const RcInner<Keep> is !null: Freeze, PhantomData<RcInner<Keep>>: Freeze, PhantomData<fn() -> AnimationController>: Freeze, &'static AnimationVTable<i64>: Freeze,

§

impl Move for InkRipple

§

impl Unpin for InkRipple
where NonZero<u32>: Unpin, &'static RenderBoxVTable: Unpin, Rc<dyn Fn(&mut App)>: Unpin, *const (): Unpin, Rc<dyn ShapeBorder>: Unpin, Rc<dyn Fn(&App) -> Rect>: Unpin, &'static AnimationVTable<f64>: Unpin, Rc<Keep>: Unpin, &'static AnimationVTable<i64>: Unpin,

§

impl UnsafeUnpin for InkRipple
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 RcInner<dyn ShapeBorder> is !null: UnsafeUnpin, PhantomData<RcInner<dyn ShapeBorder>>: UnsafeUnpin, *const RcInner<dyn Fn(&App) -> Rect> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Fn(&App) -> Rect>>: UnsafeUnpin, &'static AnimationVTable<f64>: UnsafeUnpin, *const RcInner<Keep> is !null: UnsafeUnpin, PhantomData<RcInner<Keep>>: UnsafeUnpin, PhantomData<fn() -> AnimationController>: UnsafeUnpin, &'static AnimationVTable<i64>: 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<F> InteractiveInkFeatureObject for F

Source§

fn as_interactive_ink_feature(self: Handle<F>) -> AnyInteractiveInkFeature

This feature as the erased AnyInteractiveInkFeature — what to pass where a Dart API takes an InteractiveInkFeature.
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>