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
impl InteractiveInkFeature
Sourcepub fn color<F: InteractiveInkFeatureLeaf>(this: Handle<F>, app: &App) -> Color
pub fn color<F: InteractiveInkFeatureLeaf>(this: Handle<F>, app: &App) -> Color
The ink’s color.
Sourcepub fn set_color<F: InteractiveInkFeatureLeaf>(
this: Handle<F>,
app: &mut App,
value: Color,
)
pub fn set_color<F: InteractiveInkFeatureLeaf>( this: Handle<F>, app: &mut App, value: Color, )
Sets color.
Sourcepub fn custom_border<F: InteractiveInkFeatureLeaf>(
this: Handle<F>,
app: &App,
) -> Option<ShapeBorderRef>
pub fn custom_border<F: InteractiveInkFeatureLeaf>( this: Handle<F>, app: &App, ) -> Option<ShapeBorderRef>
The ink’s optional custom border.
Sourcepub fn set_custom_border<F: InteractiveInkFeatureLeaf>(
this: Handle<F>,
app: &mut App,
value: Option<ShapeBorderRef>,
)
pub fn set_custom_border<F: InteractiveInkFeatureLeaf>( this: Handle<F>, app: &mut App, value: Option<ShapeBorderRef>, )
Sets custom_border.
Sourcepub 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>,
)
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:
- If
custom_borderis provided, it is used to determine the path for clipping. - If
custom_borderis null, andborder_radiusis provided, the canvas is clipped by anRRectcreated fromclip_callbackandborder_radius. - If
border_radiusis the defaultBorderRadius::ZERO, then theRectprovided byclip_callbackis 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.