ReorderableList constructor Null safety
- {Key? key,
- required IndexedWidgetBuilder itemBuilder,
- required int itemCount,
- required ReorderCallback onReorder,
- void onReorderStart(
- int index
- void onReorderEnd(
- int index
- double? itemExtent,
- 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,
- double? cacheExtent,
- DragStartBehavior dragStartBehavior = DragStartBehavior.start,
- ScrollViewKeyboardDismissBehavior keyboardDismissBehavior = ScrollViewKeyboardDismissBehavior.manual,
- String? restorationId,
- 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',
);