can we change crossAxisCount realtime?
Closed this issue · 5 comments
pishguy commented
can we change crossAxisCount
count by using variable?
zmtzawqlp commented
setstate
zmtzawqlp commented
or may be you want to have different column ? it doesn't support
pishguy commented
for example:
int _crossAxisCount = 0;
if (screenWidthSize > 720) {
_crossAxisCount = 3;
} else if (screenWidthSize > 520) {
_crossAxisCount = 2;
} else {
_crossAxisCount = 1;
}
WaterfallFlow.builder(
padding: EdgeInsets.all(5.0),
gridDelegate: SliverWaterfallFlowDelegateWithFixedCrossAxisCount(
crossAxisCount: _crossAxisCount ,
crossAxisSpacing: 5.0,
mainAxisSpacing: 5.0,
lastChildLayoutTypeBuilder: (index) => index == _list.length
? LastChildLayoutType.foot
: LastChildLayoutType.none,
),
zmtzawqlp commented
SliverWaterfallFlowDelegateWithMaxCrossAxisExtent(maxCrossAxisExtent:260)
or with LayoutBuilder
pishguy commented
@zmtzawqlp i think that work fine, thanks