pub struct SliverHitTestEntry { /* private fields */ }Expand description
A hit test entry used by RenderSliver.
The coordinate system used by this hit test entry is relative to the AxisDirection of
the target sliver.
Dart’s SliverHitTestEntry subclasses HitTestEntry; here it is the entry’s target,
carrying the sliver and the two positions. It becomes a HitTestEntry with From.
Implementations§
Source§impl SliverHitTestEntry
impl SliverHitTestEntry
Sourcepub fn new(
target: AnyRenderSliver,
main_axis_position: f64,
cross_axis_position: f64,
) -> SliverHitTestEntry
pub fn new( target: AnyRenderSliver, main_axis_position: f64, cross_axis_position: f64, ) -> SliverHitTestEntry
Creates a sliver hit test entry.
Sourcepub fn target(&self) -> AnyRenderSliver
pub fn target(&self) -> AnyRenderSliver
The RenderSliver that was hit.
Sourcepub fn main_axis_position(&self) -> f64
pub fn main_axis_position(&self) -> f64
The distance in the AxisDirection from the edge of the sliver’s painted area (as
given by the SliverConstraints::scroll_offset) to the hit point.
This can be an unusual direction, for example in the AxisDirection::Up case this is
a distance from the bottom of the sliver’s painted area.
Sourcepub fn cross_axis_position(&self) -> f64
pub fn cross_axis_position(&self) -> f64
The distance to the hit point in the axis opposite the SliverConstraints::axis.
If the cross axis is horizontal (i.e. the SliverConstraints::axis_direction is
either AxisDirection::Down or AxisDirection::Up), then this is a distance from
the left edge of the sliver. If the cross axis is vertical, then this is a distance
from the top edge of the sliver.
This is always a distance from the left or top of the parent, never a distance from the right or bottom.
Trait Implementations§
Source§impl Clone for SliverHitTestEntry
impl Clone for SliverHitTestEntry
impl Copy for SliverHitTestEntry
Source§impl Debug for SliverHitTestEntry
impl Debug for SliverHitTestEntry
Source§impl From<SliverHitTestEntry> for HitTestEntry
impl From<SliverHitTestEntry> for HitTestEntry
Source§fn from(entry: SliverHitTestEntry) -> HitTestEntry
fn from(entry: SliverHitTestEntry) -> HitTestEntry
Source§impl HitTestTarget for SliverHitTestEntry
impl HitTestTarget for SliverHitTestEntry
Source§fn retained_handle(&self) -> Option<HandleId>
fn retained_handle(&self) -> Option<HandleId>
retain it: Dart keeps the object alive by holding it in the path.