center property
The first child in the GrowthDirection.forward growth direction.
This child that will be at the position defined by anchor when the
ViewportOffset.pixels of offset is 0
.
Children after center will be placed in the axisDirection relative to the center.
Children before center will be placed in the opposite of the axisDirection relative to the center. These children above center will have a growth direction of GrowthDirection.reverse.
The center must be a direct child of the viewport.
Most scroll views by default are ordered GrowthDirection.forward. Changing the default values of ScrollView.anchor, ScrollView.center, or both, can configure a scroll view for GrowthDirection.reverse.
To create a local project with this code sample, run:
flutter create --sample=rendering.GrowthDirection.1 mysample
Implementation
RenderSliver? get center => _center;
Implementation
set center(RenderSliver? value) {
if (value == _center) {
return;
}
_center = value;
markNeedsLayout();
}