UIListBuilder<T> constructor
const
UIListBuilder<T> ({
- Key? key,
- required List<
T> source, - required List<
Widget> ? builder(- BuildContext context,
- T item
- List<
Widget> ? top, - List<
Widget> ? insert, - int insertPosition = 0,
- List<
Widget> ? bottom, - Axis scrollDirection = Axis.vertical,
- bool reverse = false,
- ScrollController? controller,
- bool listenWhenListenable = true,
- bool loading(
- T item
- double loadingOpacity = 0.25,
- Color? indicatorColor,
- bool? primary,
- ScrollPhysics? physics,
- ScrollBehavior? scrollBehavior,
- bool shrinkWrap = false,
- Key? center,
- bool alwaysShowScrollbar = false,
- double anchor = 0.0,
- double? cacheExtent,
- int? semanticChildCount,
- DragStartBehavior dragStartBehavior = DragStartBehavior.start,
- ScrollViewKeyboardDismissBehavior keyboardDismissBehavior = ScrollViewKeyboardDismissBehavior.manual,
- String? restorationId,
- Clip clipBehavior = Clip.hardEdge,
- 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);