Skip to main content

RenderProxyBoxWithHitTestBehavior

Trait RenderProxyBoxWithHitTestBehavior 

Source
pub trait RenderProxyBoxWithHitTestBehavior: RenderProxyBoxMixin {
    // Required method
    fn behavior(self: RenderHandle<Self>, app: &App) -> HitTestBehavior;

    // Provided methods
    fn hit_test(
        self: RenderHandle<Self>,
        app: &mut App,
        result: &mut BoxHitTestResult<'_>,
        position: Offset,
    ) -> bool { ... }
    fn hit_test_self(
        self: RenderHandle<Self>,
        app: &App,
        _position: Offset,
    ) -> bool { ... }
}
Expand description

A RenderProxyBoxMixin that allows customizing its hit-test behavior.

Flutter’s RenderProxyBoxWithHitTestBehavior. A leaf stores the HitTestBehavior and wires hit_test / hit_test_self to these.

Required Methods§

Source

fn behavior(self: RenderHandle<Self>, app: &App) -> HitTestBehavior

How to behave during hit testing when deciding how the hit test propagates to children and whether to consider targets behind this one.

Provided Methods§

Source

fn hit_test( self: RenderHandle<Self>, app: &mut App, result: &mut BoxHitTestResult<'_>, position: Offset, ) -> bool

Flutter’s hitTest: a translucent box is added even when nothing was hit.

Source

fn hit_test_self(self: RenderHandle<Self>, app: &App, _position: Offset) -> bool

Flutter’s hitTestSelf: an opaque box is hit by itself.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§