Assalamualaikum Flutter Tutorials for App Development
Widgets | GetX | BLoC | Provider | Riverpod
Flutter SliverGridDelegateWithFixedCrossAxisCount
Posted on
We will see how to use SliverGridDelegateWithFixedCrossAxisCount in flutter. You use it for show items in grid. Mostly you will use it inside Gridview.Builder
crossAxisCount: number of cross axis child elements. After this attribute value is determined, the length of the child element on the horizontal axis is determined, that is, the quotient of the horizontal axis length of the ViewPort divided by the crossAxisCount.
mainAxisSpacing: spacing in the spindle direction.
crossAxisSpacing: the spacing of child elements in the horizontal axis direction.
childAspectRatio: the ratio of child elements in the length of the horizontal axis to the length of the main axis. After crossAxisCount is specified, the horizontal axis length of the child element is determined, and then the length of the child element in the spindle can be determined through this parameter value.