ReorderableGridView.count constructor

ReorderableGridView.count({
  1. Key? key,
  2. required ReorderCallback onReorder,
  3. DragWidgetBuilder? dragWidgetBuilder,
  4. DragWidgetBuilderV2? dragWidgetBuilderV2,
  5. ScrollSpeedController? scrollSpeedController,
  6. PlaceholderBuilder? placeholderBuilder,
  7. OnDragStart? onDragStart,
  8. OnDragUpdate? onDragUpdate,
  9. List<Widget>? footer,
  10. List<Widget>? header,
  11. double mainAxisSpacing = 0.0,
  12. double crossAxisSpacing = 0.0,
  13. double childAspectRatio = 1.0,
  14. double? mainAxisExtent,
  15. bool reverse = false,
  16. ScrollController? controller,
  17. bool? primary,
  18. ScrollPhysics? physics,
  19. bool shrinkWrap = false,
  20. EdgeInsetsGeometry? padding,
  21. required int crossAxisCount,
  22. bool addAutomaticKeepAlives = true,
  23. bool addRepaintBoundaries = true,
  24. bool addSemanticIndexes = true,
  25. double? cacheExtent,
  26. List<Widget> children = const <Widget>[],
  27. int? semanticChildCount,
  28. DragStartBehavior dragStartBehavior = DragStartBehavior.start,
  29. ScrollViewKeyboardDismissBehavior keyboardDismissBehavior = ScrollViewKeyboardDismissBehavior.manual,
  30. String? restorationId,
  31. Clip clipBehavior = Clip.hardEdge,
  32. Duration? dragStartDelay,
  33. bool? dragEnabled,
  34. dynamic restrictDragScope = false,
})

Implementation

factory ReorderableGridView.count({
  Key? key,
  required ReorderCallback onReorder,
  DragWidgetBuilder? dragWidgetBuilder,
  DragWidgetBuilderV2? dragWidgetBuilderV2,
  ScrollSpeedController? scrollSpeedController,
  PlaceholderBuilder? placeholderBuilder,
  OnDragStart? onDragStart,
  OnDragUpdate? onDragUpdate,
  List<Widget>? footer,
  List<Widget>? header,
  double mainAxisSpacing = 0.0,
  double crossAxisSpacing = 0.0,
  double childAspectRatio = 1.0,
  double? mainAxisExtent,
  bool reverse = false,
  ScrollController? controller,
  bool? primary,
  ScrollPhysics? physics,
  bool shrinkWrap = false,
  EdgeInsetsGeometry? padding,
  required int crossAxisCount,
  bool addAutomaticKeepAlives = true,
  bool addRepaintBoundaries = true,
  bool addSemanticIndexes = true,
  double? cacheExtent,
  List<Widget> children = const <Widget>[],
  int? semanticChildCount,
  DragStartBehavior dragStartBehavior = DragStartBehavior.start,
  ScrollViewKeyboardDismissBehavior keyboardDismissBehavior =
      ScrollViewKeyboardDismissBehavior.manual,
  String? restorationId,
  Clip clipBehavior = Clip.hardEdge,
  Duration? dragStartDelay,
  bool? dragEnabled,
  restrictDragScope = false,
}) {
  assert(
    children.every((Widget w) => w.key != null),
    'All children of this widget must have a key.',
  );
  return ReorderableGridView(
    key: key,
    onReorder: onReorder,
    dragWidgetBuilderV2: dragWidgetBuilderV2?? DragWidgetBuilderV2.createByOldBuilder9(dragWidgetBuilder),
    scrollSpeedController: scrollSpeedController,
    placeholderBuilder: placeholderBuilder,
    onDragStart: onDragStart,
    onDragUpdate: onDragUpdate,
    childrenDelegate: SliverChildListDelegate(
      ReorderableItemView.wrapMeList(header, children, footer),
      addAutomaticKeepAlives: addAutomaticKeepAlives,
      addRepaintBoundaries: addRepaintBoundaries,
      addSemanticIndexes: addSemanticIndexes,
    ),
    gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
      crossAxisCount: crossAxisCount,
      mainAxisSpacing: mainAxisSpacing,
      crossAxisSpacing: crossAxisSpacing,
      childAspectRatio: childAspectRatio,
    ),
    reverse: reverse,
    controller: controller,
    primary: primary,
    physics: physics,
    shrinkWrap: shrinkWrap,
    padding: padding,
    cacheExtent: cacheExtent,
    semanticChildCount: semanticChildCount ?? children.length,
    dragStartBehavior: dragStartBehavior,
    keyboardDismissBehavior: keyboardDismissBehavior,
    restorationId: restorationId,
    clipBehavior: clipBehavior,
    dragEnabled: dragEnabled,
    dragStartDelay: dragStartDelay,
    restrictDragScope: restrictDragScope,
  );
}