pub struct SliverGridDelegateWithFixedCrossAxisCount {
pub cross_axis_count: i32,
pub main_axis_spacing: f64,
pub cross_axis_spacing: f64,
pub child_aspect_ratio: f64,
pub main_axis_extent: Option<f64>,
}Expand description
Creates grid layouts with a fixed number of tiles in the cross axis.
For example, if the grid is vertical, this delegate will create a layout with a fixed number of columns. If the grid is horizontal, this delegate will create a layout with a fixed number of rows.
This delegate creates grids with equally sized and spaced tiles.
Dart’s named constructor arguments are the fluent setters.
See also:
SliverGridDelegateWithMaxCrossAxisExtent, which creates a layout with tiles that have a maximum cross-axis extent.SliverGridDelegate, which creates arbitrary layouts.RenderSliverGrid, which can use this delegate to control the layout of its tiles.
Fields§
§cross_axis_count: i32The number of children in the cross axis.
main_axis_spacing: f64The number of logical pixels between each child along the main axis.
cross_axis_spacing: f64The number of logical pixels between each child along the cross axis.
child_aspect_ratio: f64The ratio of the cross-axis to the main-axis extent of each child.
main_axis_extent: Option<f64>The extent of each tile in the main axis. If provided it would define the logical pixels taken by each tile in the main-axis.
If None, child_aspect_ratio is used instead.
Implementations§
Source§impl SliverGridDelegateWithFixedCrossAxisCount
impl SliverGridDelegateWithFixedCrossAxisCount
Sourcepub fn new(cross_axis_count: i32) -> SliverGridDelegateWithFixedCrossAxisCount
pub fn new(cross_axis_count: i32) -> SliverGridDelegateWithFixedCrossAxisCount
Creates a delegate that makes grid layouts with a fixed number of tiles in the cross axis.
The cross_axis_count must be greater than zero.
Sourcepub fn main_axis_spacing(self, value: f64) -> Self
pub fn main_axis_spacing(self, value: f64) -> Self
Dart SliverGridDelegateWithFixedCrossAxisCount(mainAxisSpacing:). Must not be negative.
Sourcepub fn cross_axis_spacing(self, value: f64) -> Self
pub fn cross_axis_spacing(self, value: f64) -> Self
Dart SliverGridDelegateWithFixedCrossAxisCount(crossAxisSpacing:). Must not be negative.
Sourcepub fn child_aspect_ratio(self, value: f64) -> Self
pub fn child_aspect_ratio(self, value: f64) -> Self
Dart SliverGridDelegateWithFixedCrossAxisCount(childAspectRatio:). Must be greater than
zero.
Sourcepub fn main_axis_extent(self, value: f64) -> Self
pub fn main_axis_extent(self, value: f64) -> Self
Dart SliverGridDelegateWithFixedCrossAxisCount(mainAxisExtent:). Must not be negative.