ReorderableList constructor Null safety

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. Widget? prototypeItem,
  9. ReorderItemProxyDecorator? proxyDecorator,
  10. EdgeInsetsGeometry? padding,
  11. Axis scrollDirection = Axis.vertical,
  12. bool reverse = false,
  13. ScrollController? controller,
  14. bool? primary,
  15. ScrollPhysics? physics,
  16. bool shrinkWrap = false,
  17. double anchor = 0.0,
  18. double? cacheExtent,
  19. DragStartBehavior dragStartBehavior = DragStartBehavior.start,
  20. ScrollViewKeyboardDismissBehavior keyboardDismissBehavior = ScrollViewKeyboardDismissBehavior.manual,
  21. String? restorationId,
  22. Clip clipBehavior = Clip.hardEdge}
)

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.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,
}) : assert(itemCount >= 0),
     assert(
       itemExtent == null || prototypeItem == null,
       'You can only pass itemExtent or prototypeItem, not both',
     );