fluttercandies/waterfall_flow

can we change crossAxisCount realtime?

Closed this issue · 5 comments

can we change crossAxisCount count by using variable?

setstate

or may be you want to have different column ? it doesn't support

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,
),

SliverWaterfallFlowDelegateWithMaxCrossAxisExtent(maxCrossAxisExtent:260)

or with LayoutBuilder

@zmtzawqlp i think that work fine, thanks