0

I want to change the dynamic size of children according to its array count. It is a way same like GridLayoutManger in android java. What I did in android(java)

GridLayoutManager mng_layout = new GridLayoutManager(this, 4/*In my case 4*/); mng_layout.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() { @Override public int getSpanSize(int position) { int mod = position % 6; if (fullSizeGrid(position)) return 4; //one grid take space of four grid else if (position == 0 || position == 1) return 2; else if (position < 6) return 1; else if (position<18) { return method1(mod); } else if (position>18) { return method2(position); } else return 1; } }); 

By this I can change any grid size dynamically , I have my own formula for my layout. So Is there any way to change size of any grid in Gridview Flutter? Please Don't suggest staggered GridView it is not for me.

2 Answers 2

1

GridView does not support dynamic span, you can use spannable_grid

Sign up to request clarification or add additional context in comments.

2 Comments

but in this we can not pass unknown size list
@tailor yes, this library is quite simple, it also does not support view recycle like ListView, you should be careful not to use it in the larger data list.
0

you can wrap you grid inside container and set size of container using height and width

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.