pub trait RenderSliverFixedExtentBoxAdaptor: RenderSliverMultiBoxAdaptor {
Show 14 methods
// Required methods
fn fixed_extent_data(
self: RenderHandle<Self>,
app: &App,
) -> &RenderSliverFixedExtentBoxAdaptorData;
fn fixed_extent_data_mut(
self: RenderHandle<Self>,
app: &mut App,
) -> &mut RenderSliverFixedExtentBoxAdaptorData;
fn item_extent(self: RenderHandle<Self>, app: &App) -> Option<f64>;
// Provided methods
fn item_extent_builder(
self: RenderHandle<Self>,
app: &App,
) -> Option<ItemExtentBuilder> { ... }
fn layout_dimensions(
self: RenderHandle<Self>,
app: &App,
) -> SliverLayoutDimensions { ... }
fn index_to_layout_offset(
self: RenderHandle<Self>,
app: &App,
index: i32,
) -> f64 { ... }
fn get_min_child_index_for_scroll_offset(
self: RenderHandle<Self>,
app: &App,
scroll_offset: f64,
) -> i32 { ... }
fn get_max_child_index_for_scroll_offset(
self: RenderHandle<Self>,
app: &App,
scroll_offset: f64,
) -> i32 { ... }
fn child_index_for_scroll_offset(
self: RenderHandle<Self>,
app: &App,
scroll_offset: f64,
builder: &ItemExtentBuilder,
) -> i32 { ... }
fn estimate_max_scroll_offset(
self: RenderHandle<Self>,
app: &App,
constraints: SliverConstraints,
first_index: Option<i32>,
last_index: Option<i32>,
leading_scroll_offset: Option<f64>,
trailing_scroll_offset: Option<f64>,
) -> f64 { ... }
fn compute_max_scroll_offset(
self: RenderHandle<Self>,
app: &mut App,
_constraints: SliverConstraints,
) -> f64 { ... }
fn child_constraints(
self: RenderHandle<Self>,
app: &App,
index: i32,
) -> BoxConstraints { ... }
fn paint_extent_of(
self: RenderHandle<Self>,
app: &App,
child: AnyRenderBox,
) -> f64 { ... }
fn perform_layout(self: RenderHandle<Self>, app: &mut App) { ... }
}Expand description
A sliver that contains multiple box children that have the same extent in the main axis.
Flutter’s RenderSliverFixedExtentBoxAdaptor. An implementor answers either
item_extent or item_extent_builder.
Required Methods§
Sourcefn fixed_extent_data(
self: RenderHandle<Self>,
app: &App,
) -> &RenderSliverFixedExtentBoxAdaptorData
fn fixed_extent_data( self: RenderHandle<Self>, app: &App, ) -> &RenderSliverFixedExtentBoxAdaptorData
Mixin field access.
Sourcefn fixed_extent_data_mut(
self: RenderHandle<Self>,
app: &mut App,
) -> &mut RenderSliverFixedExtentBoxAdaptorData
fn fixed_extent_data_mut( self: RenderHandle<Self>, app: &mut App, ) -> &mut RenderSliverFixedExtentBoxAdaptorData
See fixed_extent_data.
Sourcefn item_extent(self: RenderHandle<Self>, app: &App) -> Option<f64>
fn item_extent(self: RenderHandle<Self>, app: &App) -> Option<f64>
The main-axis extent of each item.
If this is Some, item_extent_builder must be None.
If this is None, item_extent_builder must be Some.
Provided Methods§
Sourcefn item_extent_builder(
self: RenderHandle<Self>,
app: &App,
) -> Option<ItemExtentBuilder>
fn item_extent_builder( self: RenderHandle<Self>, app: &App, ) -> Option<ItemExtentBuilder>
The main-axis extent builder of each item.
If this is Some, item_extent must be None.
If this is None, item_extent must be Some.
Sourcefn layout_dimensions(
self: RenderHandle<Self>,
app: &App,
) -> SliverLayoutDimensions
fn layout_dimensions( self: RenderHandle<Self>, app: &App, ) -> SliverLayoutDimensions
The layout dimensions for the sliver.
If the sliver has not been laid out yet, this returns a SliverLayoutDimensions based
on the current constraints.
Sourcefn index_to_layout_offset(
self: RenderHandle<Self>,
app: &App,
index: i32,
) -> f64
fn index_to_layout_offset( self: RenderHandle<Self>, app: &App, index: i32, ) -> f64
The layout offset for the child with the given index.
This function uses the returned value of
item_extent_builder or the
item_extent to avoid recomputing item size repeatedly during
layout.
By default, places the children in order, without gaps, starting from layout offset zero.
Sourcefn get_min_child_index_for_scroll_offset(
self: RenderHandle<Self>,
app: &App,
scroll_offset: f64,
) -> i32
fn get_min_child_index_for_scroll_offset( self: RenderHandle<Self>, app: &App, scroll_offset: f64, ) -> i32
The minimum child index that is visible at the given scroll offset.
By default, returns a value consistent with the children being placed in order, without gaps, starting from layout offset zero.
Sourcefn get_max_child_index_for_scroll_offset(
self: RenderHandle<Self>,
app: &App,
scroll_offset: f64,
) -> i32
fn get_max_child_index_for_scroll_offset( self: RenderHandle<Self>, app: &App, scroll_offset: f64, ) -> i32
The maximum child index that is visible at the given scroll offset.
By default, returns a value consistent with the children being placed in order, without gaps, starting from layout offset zero.
Sourcefn child_index_for_scroll_offset(
self: RenderHandle<Self>,
app: &App,
scroll_offset: f64,
builder: &ItemExtentBuilder,
) -> i32
fn child_index_for_scroll_offset( self: RenderHandle<Self>, app: &App, scroll_offset: f64, builder: &ItemExtentBuilder, ) -> i32
Flutter’s _getChildIndexForScrollOffset.
Sourcefn estimate_max_scroll_offset(
self: RenderHandle<Self>,
app: &App,
constraints: SliverConstraints,
first_index: Option<i32>,
last_index: Option<i32>,
leading_scroll_offset: Option<f64>,
trailing_scroll_offset: Option<f64>,
) -> f64
fn estimate_max_scroll_offset( self: RenderHandle<Self>, app: &App, constraints: SliverConstraints, first_index: Option<i32>, last_index: Option<i32>, leading_scroll_offset: Option<f64>, trailing_scroll_offset: Option<f64>, ) -> f64
Called to estimate the total scrollable extents of this object.
Must return the total distance from the start of the child with the earliest possible index to the end of the child with the last possible index.
By default, defers to RenderSliverBoxChildManager::estimate_max_scroll_offset.
Sourcefn compute_max_scroll_offset(
self: RenderHandle<Self>,
app: &mut App,
_constraints: SliverConstraints,
) -> f64
fn compute_max_scroll_offset( self: RenderHandle<Self>, app: &mut App, _constraints: SliverConstraints, ) -> f64
Called to obtain a precise measure of the total scrollable extents of this object.
This is used when no child is available for the index corresponding to the current scroll offset, to determine the precise dimensions of the sliver.
If item_extent_builder is None, multiplies the
item_extent by the number of children reported by
RenderSliverBoxChildManager::child_count. Otherwise, sums the extents of the first
child_count children.
Sourcefn child_constraints(
self: RenderHandle<Self>,
app: &App,
index: i32,
) -> BoxConstraints
fn child_constraints( self: RenderHandle<Self>, app: &App, index: i32, ) -> BoxConstraints
Flutter’s _getChildConstraints.
Sourcefn paint_extent_of(
self: RenderHandle<Self>,
app: &App,
child: AnyRenderBox,
) -> f64
fn paint_extent_of( self: RenderHandle<Self>, app: &App, child: AnyRenderBox, ) -> f64
The body of Flutter’s paintExtentOf override.
Sourcefn perform_layout(self: RenderHandle<Self>, app: &mut App)
fn perform_layout(self: RenderHandle<Self>, app: &mut App)
The body of Flutter’s performLayout override.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".