Skip to main content

RenderAbstractLayoutBuilderMixin

Trait RenderAbstractLayoutBuilderMixin 

Source
pub trait RenderAbstractLayoutBuilderMixin: RenderObjectWithLayoutCallbackMixin {
    // Required methods
    fn callback(self: RenderHandle<Self>, app: &App) -> Option<Listener>;
    fn set_callback(
        self: RenderHandle<Self>,
        app: &mut App,
        callback: Option<Listener>,
    );

    // Provided methods
    fn update_callback(self: RenderHandle<Self>, app: &mut App, value: Listener) { ... }
    fn layout_info(self: RenderHandle<Self>, app: &App) -> AnyBoxConstraints { ... }
}
Expand description

Generic mixin for RenderObjects created by AbstractLayoutBuilders, which run a builder callback during layout (Dart’s RenderAbstractLayoutBuilderMixin / RenderConstrainedLayoutBuilder).

The callback is LayoutBuilderElement::rebuild_with_constraints; it reads the constraints from the render object rather than receiving them.

Required Methods§

Source

fn callback(self: RenderHandle<Self>, app: &App) -> Option<Listener>

The layout callback, if set.

Source

fn set_callback( self: RenderHandle<Self>, app: &mut App, callback: Option<Listener>, )

Sets (or clears) the layout callback without scheduling it.

Provided Methods§

Source

fn update_callback(self: RenderHandle<Self>, app: &mut App, value: Listener)

Change the layout callback and schedule it.

Source

fn layout_info(self: RenderHandle<Self>, app: &App) -> AnyBoxConstraints

The information the builder is given: this box’s constraints, with their subclass.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§