XCustomScrollView constructor

XCustomScrollView({
  1. Key? key,
  2. bool? bottom = true,
  3. bool? top,
  4. bool? scrollbar = true,
  5. Function? onRefresh,
  6. double? appbarHeight,
  7. Function? onLoading,
  8. dynamic init(
    1. ScrollController,
    2. RefreshController
    )?,
  9. bool? resizeToAvoidBottomInset,
  10. required PageStatus status,
  11. required Function? slivers,
  12. Widget? emptyWidget,
  13. Widget? errorWidget,
  14. XCustomScrollViewAppbar? appbar,
  15. Color backgroundColor = Colors.transparent,
  16. Widget? bottomAppBar,
  17. AppBar? xAppBar,
  18. XBottomAppBarConfig? bottomAppBarConfig,
  19. Widget? headerLoading,
  20. Widget? loadingWidget,
  21. Widget? footer,
})

Implementation

XCustomScrollView({Key? key, this.bottom = true, this.top, this.scrollbar = true, this.onRefresh, this.appbarHeight, this.onLoading, this.init, this.resizeToAvoidBottomInset, required this.status, required this.slivers, this.emptyWidget, this.errorWidget, this.appbar, this.backgroundColor = Colors.transparent, this.bottomAppBar, this.xAppBar, this.bottomAppBarConfig, this.headerLoading, this.loadingWidget, this.footer}) : super(key: key) {
  headerLoading = this.headerLoading;
  list = [];
  if (status != PageStatus.loading) {
    list = List.from(slivers!());
    if (bottomAppBar != null) {
      bottomAppBarConfig = bottomAppBarConfig ?? XBottomAppBarConfig();
      list.add(
        SliverToBoxAdapter(
          child: SizedBox(
            height: (this.bottomAppBarConfig?.bottomAppBarHeight ?? 0.0),
          ),
        ),
      );
    }
  }
}