ReorderableList constructor

const ReorderableList({
  1. Key? key,
  2. required IndexedWidgetBuilder itemBuilder,
  3. required int itemCount,
  4. required ReorderCallback onReorder,
  5. void onReorderStart(
    1. int index
    )?,
  6. void onReorderEnd(
    1. int index
    )?,
  7. double? itemExtent,
  8. ItemExtentBuilder? itemExtentBuilder,
  9. Widget? prototypeItem,
  10. ReorderItemProxyDecorator? proxyDecorator,
  11. EdgeInsetsGeometry? padding,
  12. Axis scrollDirection = Axis.vertical,
  13. bool reverse = false,
  14. ScrollController? controller,
  15. bool? primary,
  16. ScrollPhysics? physics,
  17. bool shrinkWrap = false,
  18. double anchor = 0.0,
  19. double? cacheExtent,
  20. DragStartBehavior dragStartBehavior = DragStartBehavior.start,
  21. ScrollViewKeyboardDismissBehavior keyboardDismissBehavior = ScrollViewKeyboardDismissBehavior.manual,
  22. String? restorationId,
  23. Clip clipBehavior = Clip.hardEdge,
  24. double? autoScrollerVelocityScalar,
})

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,
  required this.onReorder,
  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,
  this.cacheExtent,
  this.dragStartBehavior = DragStartBehavior.start,
  this.keyboardDismissBehavior = ScrollViewKeyboardDismissBehavior.manual,
  this.restorationId,
  this.clipBehavior = Clip.hardEdge,
  this.autoScrollerVelocityScalar,
}) : 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.',
      );