sliverList method

SliverList sliverList({
  1. int count = 0,
  2. Widget gap = const SizedBox.shrink(),
})

Implementation

SliverList sliverList({int count = 0, Widget gap = const SizedBox.shrink()}) {
  return SliverList(
      delegate: SliverChildBuilderDelegate((context, index) {
    if (index == 0) {
      return itemBuilder(context, index);
    } else {
      return Column(
        children: [
          gap,
          itemBuilder(context, index),
        ],
      );
    }
  }, childCount: count));
}