I’m trying to use a GridView.builder with dynamic height depending on the largest item in each row. A Wrap is not ok for this, because it renders all items at once. the builder is only rendering the visible items. I won’t calculate a childAspectRatio manually for each row.
I’ve made a WrapBuilder which sort of like a Wrap but uses a builder. The caveat though is that you need to know the width of the items beforehand. If that’s okay you can try using this class:
2
Answers
I’ve made a
WrapBuilder
which sort of like aWrap
but uses a builder. The caveat though is that you need to know the width of the items beforehand. If that’s okay you can try using this class:You might need to tweak it for your use case. In my case I have a list that is some data and the
itemBuilder
takes one of this data as parameter.you can pass height as variable in list and then set height for the row from list