Skip to main content

RenderAnimatedOpacityMixin

Trait RenderAnimatedOpacityMixin 

Source
pub trait RenderAnimatedOpacityMixin: RenderObjectWithChildMixin<ChildType = AnyRenderBox> + RenderBox {
    // Required methods
    fn animated_opacity_data(
        self: RenderHandle<Self>,
        app: &App,
    ) -> &RenderAnimatedOpacityData;
    fn animated_opacity_data_mut(
        self: RenderHandle<Self>,
        app: &mut App,
    ) -> &mut RenderAnimatedOpacityData;

    // Provided methods
    fn is_repaint_boundary(self: RenderHandle<Self>, app: &App) -> bool { ... }
    fn update_composited_layer(
        self: RenderHandle<Self>,
        app: &mut App,
        old_layer: Option<AnyOffsetLayer>,
    ) -> AnyOffsetLayer { ... }
    fn opacity(self: RenderHandle<Self>, app: &App) -> AnyAnimation<f64> { ... }
    fn set_opacity(
        self: RenderHandle<Self>,
        app: &mut App,
        value: AnyAnimation<f64>,
    ) { ... }
    fn did_attach(self: RenderHandle<Self>, app: &mut App) { ... }
    fn did_detach(self: RenderHandle<Self>, app: &mut App) { ... }
    fn opacity_listener(self: RenderHandle<Self>) -> Listener { ... }
    fn update_opacity(self: RenderHandle<Self>, app: &mut App) { ... }
    fn paint(
        self: RenderHandle<Self>,
        app: &mut App,
        context: &mut PaintingContext,
        offset: Offset,
    )
       where Self: RenderProxyBoxMixin { ... }
}
Expand description

Implementation of RenderAnimatedOpacity and RenderSliverAnimatedOpacity.

This mixin allows the logic of animating opacity to be used with different layout models, e.g. the way that RenderAnimatedOpacity uses it for RenderBox and RenderSliverAnimatedOpacity uses it for RenderSliver.

The host wires the virtuals: is_repaint_boundary, update_composited_layer, did_attach, did_detach, and paint call the same-named functions here.

Required Methods§

Provided Methods§

Source

fn is_repaint_boundary(self: RenderHandle<Self>, app: &App) -> bool

Flutter’s isRepaintBoundary.

Source

fn update_composited_layer( self: RenderHandle<Self>, app: &mut App, old_layer: Option<AnyOffsetLayer>, ) -> AnyOffsetLayer

Flutter’s updateCompositedLayer.

Source

fn opacity(self: RenderHandle<Self>, app: &App) -> AnyAnimation<f64>

The animation that drives this render object’s opacity.

An opacity of 1.0 is fully opaque. An opacity of 0.0 is fully transparent (i.e., invisible).

Source

fn set_opacity( self: RenderHandle<Self>, app: &mut App, value: AnyAnimation<f64>, )

Sets opacity.

Source

fn did_attach(self: RenderHandle<Self>, app: &mut App)

Flutter’s attach after super.attach(owner).

Source

fn did_detach(self: RenderHandle<Self>, app: &mut App)

Flutter’s detach before super.detach().

Source

fn opacity_listener(self: RenderHandle<Self>) -> Listener

The _updateOpacity tear-off, equal to itself across registrations.

Source

fn update_opacity(self: RenderHandle<Self>, app: &mut App)

Flutter’s _updateOpacity.

Source

fn paint( self: RenderHandle<Self>, app: &mut App, context: &mut PaintingContext, offset: Offset, )
where Self: RenderProxyBoxMixin,

Flutter’s paint: nothing when fully transparent, else the proxy paint.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§