getListViewInternal method

Widget getListViewInternal(
  1. Widget sliver
)

Implementation

Widget getListViewInternal(Widget sliver){
  Widget sliverList = sliver;

  final slivers = <Widget>[];
  if(widget.header != null) {
    slivers.add(SliverToBoxAdapter(child: widget.header,),);
  }
  slivers.add(sliverList);

  Widget scrollView;
  if(widget.withOverlapsAbsorber == true) {
    scrollView = Builder(
      builder: (BuildContext context) {
        final innerSlivers = <Widget>[];
        innerSlivers.add(SliverOverlapInjector(
          handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context),
        ));
        innerSlivers.addAll(slivers);

        return CustomScrollView(
            physics: widget.scrollPhysics ?? NUICustomScrollPhysics(),
            scrollDirection: orientation(),
            shrinkWrap: widget.shrinkWrap ?? false,
            key: PageStorageKey<String>(id),
            slivers: innerSlivers
        );
      },
    );
  }
  else {
    scrollView = CustomScrollView(
        physics: widget.scrollPhysics ?? NUICustomScrollPhysics(),
        scrollDirection: orientation(),
        shrinkWrap: widget.shrinkWrap ?? false,
//        controller: scrollController(),
        slivers: slivers
    );
  }
  return scrollView;
}