HcDragAndDropView constructor
- Key? key,
- bool reverse = false,
- Widget? header,
- ScrollController? controller,
- bool? primary,
- ScrollPhysics? physics,
- bool isCustomFeedback = false,
- bool isCustomChildWhenDragging = false,
- required WillAcceptCallback onWillAccept,
- required ReorderCallback onReorder,
- EdgeInsetsGeometry? padding,
- required SliverGridDelegate gridDelegate,
- required IndexedWidgetBuilder itemBuilder,
- int? itemCount,
- bool addAutomaticKeepAlives = true,
- bool addRepaintBoundaries = true,
- bool addSemanticIndexes = true,
- double? cacheExtent,
- int? semanticChildCount,
- DragStartBehavior dragStartBehavior = DragStartBehavior.start,
- ScrollViewKeyboardDismissBehavior keyboardDismissBehavior = ScrollViewKeyboardDismissBehavior.manual,
- WidgetPositionBuilder? feedback,
- WidgetPositionBuilder? childWhenDragging,
DragAndDropGridView has the all same parameters (except shrinkWrap and scrollDirection)
that GridView.builder constructor
Providing a non-null itemCount improves the ability of the GridView to
estimate the maximum scroll extent.
itemBuilder will be called only with indices greater than or equal to
zero and less than itemCount.
The gridDelegate argument must not be null.
The addAutomaticKeepAlives argument corresponds to the
SliverChildBuilderDelegate.addAutomaticKeepAlive property. The
addRepaintBoundaries argument corresponds to the
SliverChildBuilderDelegate.addRepaintBoundaries property. Both must not
be null.
this onReorder have the old index and new index. Called when an acceptable piece of data was dropped over this grid child.
onWillAccept this funciton allows you to validate if you want to accept the change in the order of the gridViewItems.
If you always want to accept the change simply return true
Implementation
const HcDragAndDropView({
Key? key,
bool reverse = false,
Widget? header,
ScrollController? controller,
bool? primary,
ScrollPhysics? physics,
bool isCustomFeedback = false,
bool isCustomChildWhenDragging = false,
required WillAcceptCallback onWillAccept,
required ReorderCallback onReorder,
EdgeInsetsGeometry? padding,
required SliverGridDelegate gridDelegate,
required IndexedWidgetBuilder itemBuilder,
int? itemCount,
bool addAutomaticKeepAlives = true,
bool addRepaintBoundaries = true,
bool addSemanticIndexes = true,
double? cacheExtent,
int? semanticChildCount,
DragStartBehavior dragStartBehavior = DragStartBehavior.start,
ScrollViewKeyboardDismissBehavior keyboardDismissBehavior =
ScrollViewKeyboardDismissBehavior.manual,
WidgetPositionBuilder? feedback,
WidgetPositionBuilder? childWhenDragging,
}) : super(
key: key,
reverse: reverse,
header: header,
itemBuilder: itemBuilder,
onWillAccept: onWillAccept,
feedback: feedback,
onReorder: onReorder,
childWhenDragging: childWhenDragging,
controller: controller,
padding: padding,
semanticChildCount: semanticChildCount,
physics: physics,
addAutomaticKeepAlive: addAutomaticKeepAlives,
addRepaintBoundaries: addRepaintBoundaries,
addSemanticIndexes: addSemanticIndexes,
cacheExtent: cacheExtent,
itemCount: itemCount,
primary: primary,
isCustomFeedback: isCustomFeedback,
isCustomChildWhenDragging: isCustomChildWhenDragging,
gridDelegate: gridDelegate,
dragStartBehavior: dragStartBehavior,
keyboardDismissBehavior: keyboardDismissBehavior,
);