pub struct InkHighlight { /* private fields */ }Expand description
A visual emphasis on a part of a Material receiving user interaction.
This object is rarely created directly. Instead of creating an ink highlight
directly, consider using an InkResponse or
InkWell widget, which uses gestures (such as tap and long-press) to
trigger ink highlights.
See also:
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 highlight is painted.InkSplash, which is an ink feature that shows a reaction to user input on aMaterial.Ink, a convenience widget for drawing images and other decorations on Material widgets.
Implementations§
Source§impl InkHighlight
impl InkHighlight
Sourcepub const DEFAULT_FADE_DURATION: Duration = K_DEFAULT_HIGHLIGHT_FADE_DURATION
pub const DEFAULT_FADE_DURATION: Duration = K_DEFAULT_HIGHLIGHT_FADE_DURATION
The default fade duration of InkHighlight::new: Dart’s
_kDefaultHighlightFadeDuration.
Sourcepub fn new(
app: &mut App,
controller: AnyMaterialInkController,
reference_box: AnyRenderBox,
color: Color,
text_direction: TextDirection,
shape: BoxShape,
radius: Option<f64>,
border_radius: Option<BorderRadius>,
custom_border: Option<ShapeBorderRef>,
rect_callback: Option<RectCallback>,
on_removed: Option<Listener>,
fade_duration: Duration,
) -> Ref<InkHighlight>
pub fn new( app: &mut App, controller: AnyMaterialInkController, reference_box: AnyRenderBox, color: Color, text_direction: TextDirection, shape: BoxShape, radius: Option<f64>, border_radius: Option<BorderRadius>, custom_border: Option<ShapeBorderRef>, rect_callback: Option<RectCallback>, on_removed: Option<Listener>, fade_duration: Duration, ) -> Ref<InkHighlight>
Begin a highlight animation.
The controller argument is typically obtained via
Material::of(app, context).
If a rect_callback is given, then it provides the highlight rectangle,
otherwise, the highlight rectangle is coincident with the reference_box.
When the highlight is removed, on_removed will be called.
Dart’s defaults: shape BoxShape::Rectangle, border_radius
BorderRadius::ZERO, fade_duration InkHighlight::DEFAULT_FADE_DURATION.
Sourcepub fn active(self: Handle<Self>, app: &App) -> bool
pub fn active(self: Handle<Self>, app: &App) -> bool
Whether this part of the material is being visually emphasized.
Sourcepub fn activate(self: Handle<Self>, app: &mut App)
pub fn activate(self: Handle<Self>, app: &mut App)
Start visually emphasizing this part of the material.
Sourcepub fn deactivate(self: Handle<Self>, app: &mut App)
pub fn deactivate(self: Handle<Self>, app: &mut App)
Stop visually emphasizing this part of the material.
Trait Implementations§
Source§impl InkFeatureLeaf for InkHighlight
impl InkFeatureLeaf for InkHighlight
Source§impl InkFeatureLeafData for InkHighlight
impl InkFeatureLeafData for InkHighlight
Source§fn ink_feature(&self) -> &InkFeatureData
fn ink_feature(&self) -> &InkFeatureData
InkFeature bag.Source§fn ink_feature_mut(&mut self) -> &mut InkFeatureData
fn ink_feature_mut(&mut self) -> &mut InkFeatureData
InkFeature bag, mutably.Source§impl InteractiveInkFeatureLeafData for InkHighlight
impl InteractiveInkFeatureLeafData for InkHighlight
Source§fn interactive_ink_feature(&self) -> &InteractiveInkFeatureData
fn interactive_ink_feature(&self) -> &InteractiveInkFeatureData
InteractiveInkFeature bag.Source§fn interactive_ink_feature_mut(&mut self) -> &mut InteractiveInkFeatureData
fn interactive_ink_feature_mut(&mut self) -> &mut InteractiveInkFeatureData
InteractiveInkFeature bag, mutably.Auto Trait Implementations§
impl !RefUnwindSafe for InkHighlight
impl !Send for InkHighlight
impl !Sync for InkHighlight
impl !UnwindSafe for InkHighlight
impl Forget for InkHighlight
impl Freeze for InkHighlightwhere
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<i64>: Freeze,
*const RcInner<Keep> is !null: Freeze,
PhantomData<RcInner<Keep>>: Freeze,
PhantomData<fn() -> AnimationController>: Freeze,
impl Move for InkHighlight
impl Unpin for InkHighlight
impl UnsafeUnpin for InkHighlightwhere
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<i64>: UnsafeUnpin,
*const RcInner<Keep> is !null: UnsafeUnpin,
PhantomData<RcInner<Keep>>: UnsafeUnpin,
PhantomData<fn() -> AnimationController>: 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
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
AnyInkFeature — what to pass where a Dart API takes an
InkFeature.Source§impl<F> InteractiveInkFeatureObject for Fwhere
F: InteractiveInkFeatureLeaf,
impl<F> InteractiveInkFeatureObject for Fwhere
F: InteractiveInkFeatureLeaf,
Source§fn as_interactive_ink_feature(self: Handle<F>) -> AnyInteractiveInkFeature
fn as_interactive_ink_feature(self: Handle<F>) -> AnyInteractiveInkFeature
AnyInteractiveInkFeature — what to pass where a Dart API
takes an InteractiveInkFeature.