dynamic fixed height for grid view in flutter

157

You can put your GridView in some Expanded widget and use

shrinkWrap: true,

in GridView attribute .

So the GridView will wrap to the Expanded height.

Do not forget to change settings about scrolls.

Share:
157
HoseinGhanbari
Author by

HoseinGhanbari

Updated on December 31, 2022

Comments

  • HoseinGhanbari
    HoseinGhanbari over 1 year

    I need a 2*2 GridView which always take as much height as it needed to display the 2*2 grid. but the problem is that I have to specify a fixed height which cause undesired layout / scrolling.