fluttercandies/waterfall_flow

CustomScrollView里的SliverWaterfallFlow可以指定childCount数量吗

Closed this issue · 1 comments

你好,我想请问一下,这个方式生成可以指定生成数量吗?
child: CustomScrollView( slivers: [ SliverWaterfallFlow( delegate: SliverChildBuilderDelegate((BuildContext c, int index) { return Container( decoration: BoxDecoration(color: Colors.grey[300]), alignment: Alignment.center, child: Text( '$index', style: TextStyle(color: Colors.black), ), //height: index == 5 ? 1500.0 : 100.0, height: ((index % 3) + 1) * 100.0, ); }), gridDelegate: SliverWaterfallFlowDelegateWithFixedCrossAxisCount( crossAxisCount: 2, crossAxisSpacing: 5, mainAxisSpacing: 5, collectGarbage: (List<int> garbages) { print('collect garbage : $garbages'); }, viewportBuilder: (int firstIndex, int lastIndex) { print('viewport : [$firstIndex,$lastIndex]'); }, ), ) ], ),

可以 SliverChildBuilderDelegate 里面设置