ReorderableList constructor

const ReorderableList({
  1. Key? key,
  2. required IndexedWidgetBuilder itemBuilder,
  3. required int itemCount,
  4. @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,
  5. ReorderCallback? onReorderItem,
  6. void onReorderStart(
    1. int index
    )?,
  7. void onReorderEnd(
    1. int index
    )?,
  8. double? itemExtent,
  9. ItemExtentBuilder? itemExtentBuilder,
  10. Widget? prototypeItem,
  11. ReorderItemProxyDecorator? proxyDecorator,
  12. EdgeInsetsGeometry? padding,
  13. Axis scrollDirection = Axis.vertical,
  14. bool reverse = false,
  15. ScrollController? controller,
  16. bool? primary,
  17. ScrollPhysics? physics,
  18. bool shrinkWrap = false,
  19. double anchor = 0.0,
  20. @Deprecated('Use scrollCacheExtent instead. ' 'This feature was deprecated after v3.41.0-0.0.pre.') double? cacheExtent,
  21. ScrollCacheExtent? scrollCacheExtent,
  22. DragStartBehavior dragStartBehavior = DragStartBehavior.start,
  23. ScrollViewKeyboardDismissBehavior? keyboardDismissBehavior,
  24. String? restorationId,
  25. Clip clipBehavior = Clip.hardEdge,
  26. double? autoScrollerVelocityScalar,
  27. 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.',
     );