buildSlivers method

List<Widget> buildSlivers()

Build slivers.

Implementation

List<Widget> buildSlivers() {
  final header = buildHeader();
  final footer = buildFooter();
  Widget? emptyWidget;
  if (isEmpty) {
    emptyWidget = buildEmptyWidget();
  }
  return [
    if (header.position == IndicatorPosition.locator)
      const HeaderLocator.sliver(),
    if (emptyWidget != null)
      SliverFillViewport(
        delegate: SliverChildBuilderDelegate(
          (context, index) {
            return emptyWidget;
          },
          childCount: 1,
        ),
      ),
    buildSliver(),
    if (footer.position == IndicatorPosition.locator)
      const FooterLocator.sliver(),
  ];
}