UIListBuilder<T> constructor

const UIListBuilder<T>({
  1. Key? key,
  2. required List<T> source,
  3. required List<Widget>? builder(
    1. BuildContext context,
    2. T item
    ),
  4. List<Widget>? top,
  5. List<Widget>? insert,
  6. int insertPosition = 0,
  7. List<Widget>? bottom,
  8. Axis scrollDirection = Axis.vertical,
  9. bool reverse = false,
  10. ScrollController? controller,
  11. bool listenWhenListenable = true,
  12. bool loading(
    1. T item
    )?,
  13. double loadingOpacity = 0.25,
  14. Color? indicatorColor,
  15. bool? primary,
  16. ScrollPhysics? physics,
  17. ScrollBehavior? scrollBehavior,
  18. bool shrinkWrap = false,
  19. Key? center,
  20. bool alwaysShowScrollbar = false,
  21. double anchor = 0.0,
  22. double? cacheExtent,
  23. int? semanticChildCount,
  24. DragStartBehavior dragStartBehavior = DragStartBehavior.start,
  25. ScrollViewKeyboardDismissBehavior keyboardDismissBehavior = ScrollViewKeyboardDismissBehavior.manual,
  26. String? restorationId,
  27. Clip clipBehavior = Clip.hardEdge,
  28. EdgeInsetsGeometry? padding,
})

Creates a ScrollView that creates custom scroll effects using slivers.

See the ScrollView constructor for more details on these arguments.

Implementation

const UIListBuilder({
  Key? key,
  required this.source,
  required this.builder,
  this.top,
  this.insert,
  this.insertPosition = 0,
  this.bottom,
  this.scrollDirection = Axis.vertical,
  this.reverse = false,
  this.controller,
  this.listenWhenListenable = true,
  this.loading,
  this.loadingOpacity = 0.25,
  this.indicatorColor,
  bool? primary,
  ScrollPhysics? physics,
  this.scrollBehavior,
  this.shrinkWrap = false,
  this.center,
  this.alwaysShowScrollbar = false,
  this.anchor = 0.0,
  this.cacheExtent,
  this.semanticChildCount,
  this.dragStartBehavior = DragStartBehavior.start,
  this.keyboardDismissBehavior = ScrollViewKeyboardDismissBehavior.manual,
  this.restorationId,
  this.clipBehavior = Clip.hardEdge,
  this.padding,
})  : assert(
        !(controller != null && primary == true),
        'Primary ScrollViews obtain their ScrollController via inheritance from a PrimaryScrollController widget. '
        'You cannot both set primary to true and pass an explicit controller.',
      ),
      assert(!shrinkWrap || center == null),
      assert(anchor >= 0.0 && anchor <= 1.0),
      assert(semanticChildCount == null || semanticChildCount >= 0),
      primary = primary ??
          controller == null && identical(scrollDirection, Axis.vertical),
      physics = physics ??
          (primary == true ||
                  (primary == null &&
                      controller == null &&
                      identical(scrollDirection, Axis.vertical))
              ? const AlwaysScrollableScrollPhysics()
              : null),
      _topLength = top.length,
      _length = top.length + source.length + bottom.length + insert.length,
      _topSourcelength = top.length + source.length + insert.length,
      super(key: key);