SliverWaterfallFlow.count constructor

  1. Key? key,
  2. required int crossAxisCount,
  3. double mainAxisSpacing = 0.0,
  4. double crossAxisSpacing = 0.0,
  5. List<Widget> children = const <Widget>[],
  6. LastChildLayoutTypeBuilder? lastChildLayoutTypeBuilder,
  7. CollectGarbage? collectGarbage,
  8. ViewportBuilder? viewportBuilder,
  9. bool closeToTrailing = false,

Creates a sliver that places multiple box children in a two dimensional arrangement and masonry layout with a fixed number of tiles in the cross axis.

Uses a SliverWaterfallFlowDelegate as the gridDelegate, and a SliverChildListDelegate as the delegate.

See also:

  • new WaterfallFlow.count, the equivalent constructor for WaterfallFlow widgets.


  Key? key,
  required int crossAxisCount,
  double mainAxisSpacing = 0.0,
  double crossAxisSpacing = 0.0,
  List<Widget> children = const <Widget>[],
  LastChildLayoutTypeBuilder? lastChildLayoutTypeBuilder,
  CollectGarbage? collectGarbage,
  ViewportBuilder? viewportBuilder,
  bool closeToTrailing = false,
})  : gridDelegate = SliverWaterfallFlowDelegateWithFixedCrossAxisCount(
        crossAxisCount: crossAxisCount,
        mainAxisSpacing: mainAxisSpacing,
        crossAxisSpacing: crossAxisSpacing,
        lastChildLayoutTypeBuilder: lastChildLayoutTypeBuilder,
        collectGarbage: collectGarbage,
        viewportBuilder: viewportBuilder,
        closeToTrailing: closeToTrailing,
      super(key: key, delegate: SliverChildListDelegate(children));