ReorderableList constructor
- Key? key,
- required IndexedWidgetBuilder itemBuilder,
- required int itemCount,
- @Deprecated('Use the onReorderItem callback instead. ' 'The onReorderItem callback adjusts the newIndex parameter for a removed item at the oldIndex. ' 'This feature was deprecated after v3.41.0-0.0.pre.') ReorderCallback? onReorder,
- ReorderCallback? onReorderItem,
- void onReorderStart(
- int index
- void onReorderEnd(
- int index
- double? itemExtent,
- ItemExtentBuilder? itemExtentBuilder,
- Widget? prototypeItem,
- ReorderItemProxyDecorator? proxyDecorator,
- EdgeInsetsGeometry? padding,
- Axis scrollDirection = Axis.vertical,
- bool reverse = false,
- ScrollController? controller,
- bool? primary,
- ScrollPhysics? physics,
- bool shrinkWrap = false,
- double anchor = 0.0,
- @Deprecated('Use scrollCacheExtent instead. ' 'This feature was deprecated after v3.41.0-0.0.pre.') double? cacheExtent,
- ScrollCacheExtent? scrollCacheExtent,
- DragStartBehavior dragStartBehavior = DragStartBehavior.start,
- ScrollViewKeyboardDismissBehavior? keyboardDismissBehavior,
- String? restorationId,
- Clip clipBehavior = Clip.hardEdge,
- double? autoScrollerVelocityScalar,
- ReorderDragBoundaryProvider? dragBoundaryProvider,
Creates a scrolling container that allows the user to interactively reorder the list items.
The itemCount must be greater than or equal to zero.
Implementation
const ReorderableList({
super.key,
required this.itemBuilder,
required this.itemCount,
@Deprecated(
'Use the onReorderItem callback instead. '
'The onReorderItem callback adjusts the newIndex parameter for a removed item at the oldIndex. '
'This feature was deprecated after v3.41.0-0.0.pre.',
)
this.onReorder,
this.onReorderItem,
this.onReorderStart,
this.onReorderEnd,
this.itemExtent,
this.itemExtentBuilder,
this.prototypeItem,
this.proxyDecorator,
this.padding,
this.scrollDirection = Axis.vertical,
this.reverse = false,
this.controller,
this.primary,
this.physics,
this.shrinkWrap = false,
this.anchor = 0.0,
@Deprecated(
'Use scrollCacheExtent instead. '
'This feature was deprecated after v3.41.0-0.0.pre.',
)
this.cacheExtent,
this.scrollCacheExtent,
this.dragStartBehavior = DragStartBehavior.start,
this.keyboardDismissBehavior,
this.restorationId,
this.clipBehavior = Clip.hardEdge,
this.autoScrollerVelocityScalar,
this.dragBoundaryProvider,
}) : assert(itemCount >= 0),
assert(
(itemExtent == null && prototypeItem == null) ||
(itemExtent == null && itemExtentBuilder == null) ||
(prototypeItem == null && itemExtentBuilder == null),
'You can only pass one of itemExtent, prototypeItem and itemExtentBuilder.',
),
assert(
(onReorderItem != null && onReorder == null) ||
(onReorderItem == null && onReorder != null),
'The onReorder callback is obsolete and is replaced by onReorderItem. '
'Remove the onReorder callback when both callbacks are provided.',
);