pub struct SliverGridRegularTileLayout {
pub cross_axis_count: i32,
pub main_axis_stride: f64,
pub cross_axis_stride: f64,
pub child_main_axis_extent: f64,
pub child_cross_axis_extent: f64,
pub reverse_cross_axis: bool,
}Expand description
A SliverGridLayout that uses equally sized and spaced tiles.
Rather that providing a grid with a SliverGridLayout directly, you instead provide the
grid a SliverGridDelegate, which can compute a SliverGridLayout given the current
SliverConstraints.
This layout is used by SliverGridDelegateWithFixedCrossAxisCount and
SliverGridDelegateWithMaxCrossAxisExtent.
Fields§
§cross_axis_count: i32The number of children in the cross axis.
main_axis_stride: f64The number of pixels from the leading edge of one tile to the leading edge of the next tile in the main axis.
cross_axis_stride: f64The number of pixels from the leading edge of one tile to the leading edge of the next tile in the cross axis.
child_main_axis_extent: f64The number of pixels from the leading edge of one tile to the trailing edge of the same tile in the main axis.
child_cross_axis_extent: f64The number of pixels from the leading edge of one tile to the trailing edge of the same tile in the cross axis.
reverse_cross_axis: boolWhether the children should be placed in the opposite order of increasing coordinates in the cross axis.
For example, if the cross axis is horizontal, the children are placed from left to right
when reverse_cross_axis is false and from right to left when
it is true.
Typically set to the return value of axis_direction_is_reversed applied to the
SliverConstraints::cross_axis_direction.
Implementations§
Source§impl SliverGridRegularTileLayout
impl SliverGridRegularTileLayout
Sourcepub fn new(
cross_axis_count: i32,
main_axis_stride: f64,
cross_axis_stride: f64,
child_main_axis_extent: f64,
child_cross_axis_extent: f64,
reverse_cross_axis: bool,
) -> SliverGridRegularTileLayout
pub fn new( cross_axis_count: i32, main_axis_stride: f64, cross_axis_stride: f64, child_main_axis_extent: f64, child_cross_axis_extent: f64, reverse_cross_axis: bool, ) -> SliverGridRegularTileLayout
Creates a layout that uses equally sized and spaced tiles.
All of the arguments must not be negative. The cross_axis_count argument must be greater
than zero.
Trait Implementations§
Source§impl Clone for SliverGridRegularTileLayout
impl Clone for SliverGridRegularTileLayout
impl Copy for SliverGridRegularTileLayout
Source§impl Debug for SliverGridRegularTileLayout
impl Debug for SliverGridRegularTileLayout
Source§impl SliverGridLayout for SliverGridRegularTileLayout
impl SliverGridLayout for SliverGridRegularTileLayout
Source§fn get_min_child_index_for_scroll_offset(&self, scroll_offset: f64) -> i32
fn get_min_child_index_for_scroll_offset(&self, scroll_offset: f64) -> i32
Source§fn get_max_child_index_for_scroll_offset(&self, scroll_offset: f64) -> i32
fn get_max_child_index_for_scroll_offset(&self, scroll_offset: f64) -> i32
Source§fn get_geometry_for_child_index(&self, index: i32) -> SliverGridGeometry
fn get_geometry_for_child_index(&self, index: i32) -> SliverGridGeometry
Source§fn compute_max_scroll_offset(&self, child_count: i32) -> f64
fn compute_max_scroll_offset(&self, child_count: i32) -> f64
child_count
children in total.