Skip to main content

InteractiveInkFeature

Struct InteractiveInkFeature 

Source
pub struct InteractiveInkFeature;
Expand description

Dart’s abstract InteractiveInkFeature: an ink feature that displays a color “splash” in response to a user gesture that can be confirmed or canceled.

Its bodies are associated fns taking the leaf’s Handle; its virtuals are InteractiveInkFeatureLeaf’s, and its fields are InteractiveInkFeatureData.

Implementations§

Source§

impl InteractiveInkFeature

Source

pub fn color<F: InteractiveInkFeatureLeaf>(this: Handle<F>, app: &App) -> Color

The ink’s color.

Source

pub fn set_color<F: InteractiveInkFeatureLeaf>( this: Handle<F>, app: &mut App, value: Color, )

Sets color.

Source

pub fn custom_border<F: InteractiveInkFeatureLeaf>( this: Handle<F>, app: &App, ) -> Option<ShapeBorderRef>

The ink’s optional custom border.

Source

pub fn set_custom_border<F: InteractiveInkFeatureLeaf>( this: Handle<F>, app: &mut App, value: Option<ShapeBorderRef>, )

Source

pub fn paint_ink_circle( app: &App, canvas: &mut Canvas, transform: &Matrix4, paint: &Paint, center: Offset, radius: f64, text_direction: Option<TextDirection>, custom_border: Option<&dyn ShapeBorder>, border_radius: BorderRadius, clip_callback: Option<&RectCallback>, )

Draws an ink splash or ink ripple on the passed in Canvas.

The transform argument is the Matrix4 transform that typically shifts the coordinate space of the canvas to the space in which the ink circle is to be painted.

center is the Offset from origin of the canvas where the center of the circle is drawn.

paint takes a Paint object that describes the styles used to draw the ink circle. For example, paint can specify properties like color, strokewidth, colorFilter.

radius is the radius of ink circle to be drawn on canvas.

clip_callback is the callback used to obtain the Rect used for clipping the ink effect. If clip_callback is null, no clipping is performed on the ink circle.

Clipping can happen in 3 different ways:

  1. If custom_border is provided, it is used to determine the path for clipping.
  2. If custom_border is null, and border_radius is provided, the canvas is clipped by an RRect created from clip_callback and border_radius.
  3. If border_radius is the default BorderRadius::ZERO, then the Rect provided by clip_callback is used for clipping.

text_direction is used by custom_border if it is non-null. This allows the custom_border’s path to be properly defined if it was the path was expressed in terms of “start” and “end” instead of “left” and “right”.

For examples on how the function is used, see InkSplash and InkRipple.

Auto Trait Implementations§

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

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,