0

Since i am new to flutter, In the case of gridview.builder, By providing "childAspectRatio: 1/1", the height differs, some devices i am getting overflow by 10pixels etc, is their any way we can provide specific height to grid item.

GridView.builder(
  gridDelegate: new SliverGridDelegateWithFixedCrossAxisCount(
    crossAxisCount: 2,
    crossAxisSpacing: 0.0,
    childAspectRatio: 1 / 1),
  itemBuilder: (BuildContext context, int index) {
    Map<String, String> product = products[index].cast<String, String>();
    return _buildGridItems(index, product);
  },
  itemCount: products.length,
  shrinkWrap: true,
  physics: ClampingScrollPhysics(),
)
Michael Yuwono
  • 2,452
  • 1
  • 14
  • 32
Sonu Babu
  • 11
  • 1
  • 3

1 Answers1

0

Only workaround for this problem that i have found is to use expanded widget and use the flex property to size the widgets (if you have column as the child).