GridView.count vs GridView.builder Difference In Flutter

Viewed 1771

What is the difference between gridview.builder and gridview.count in Flutter?

1 Answers

Like any other .builder GridView.builder create Widgets on demand.

Creates a scrollable, 2D array of widgets that are created on demand. This constructor is appropriate for grid views with a large (or infinite) number of children because the builder is called only for those children that are actually visible.

But GridView.count allows to directly have crossAxisCount that use to count item on single row. Full Grandview will follow this pattern.

Creates a scrollable, 2D array of widgets with a fixed number of tiles in the cross axis.

When you have the large number of widgets, consider using GridView.builder to get better performance. Also, using gridDelegate gives you more controls over UI.

You can explore GridView.

Related