ReorderableGridView.builder constructor

ReorderableGridView.builder({
  1. Key? key,
  2. required ReorderCallback onReorder,
  3. ScrollSpeedController? scrollSpeedController,
  4. DragWidgetBuilder? dragWidgetBuilder,
  5. DragWidgetBuilderV2? dragWidgetBuilderV2,
  6. PlaceholderBuilder? placeholderBuilder,
  7. OnDragStart? onDragStart,
  8. OnDragUpdate? onDragUpdate,
  9. bool reverse = false,
  10. ScrollController? controller,
  11. bool? primary,
  12. ScrollPhysics? physics,
  13. bool shrinkWrap = false,
  14. EdgeInsetsGeometry? padding,
  15. required SliverGridDelegate gridDelegate,
  16. required IndexedWidgetBuilder itemBuilder,
  17. int? itemCount,
  18. bool addAutomaticKeepAlives = true,
  19. bool addRepaintBoundaries = true,
  20. bool addSemanticIndexes = true,
  21. double? cacheExtent,
  22. int? semanticChildCount,
  23. DragStartBehavior dragStartBehavior = DragStartBehavior.start,
  24. ScrollViewKeyboardDismissBehavior keyboardDismissBehavior = ScrollViewKeyboardDismissBehavior.manual,
  25. String? restorationId,
  26. Clip clipBehavior = Clip.hardEdge,
  27. Duration? dragStartDelay,
  28. bool? dragEnabled,
  29. bool restrictDragScope = false,
})

Implementation

ReorderableGridView.builder({
  Key? key,
  required ReorderCallback onReorder,
  ScrollSpeedController? scrollSpeedController,
  DragWidgetBuilder? dragWidgetBuilder,
  DragWidgetBuilderV2? dragWidgetBuilderV2,
  PlaceholderBuilder? placeholderBuilder,
  OnDragStart? onDragStart,
  OnDragUpdate? onDragUpdate,
  bool reverse = false,
  ScrollController? controller,
  bool? primary,
  ScrollPhysics? physics,
  bool shrinkWrap = false,
  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,
  String? restorationId,
  Clip clipBehavior = Clip.hardEdge,
  Duration? dragStartDelay,
  bool? dragEnabled,
  bool restrictDragScope = false,
}) : this(
        key: key,
        onReorder: onReorder,
        dragWidgetBuilderV2: dragWidgetBuilderV2?? DragWidgetBuilderV2.createByOldBuilder9(dragWidgetBuilder),
        scrollSpeedController: scrollSpeedController,
        placeholderBuilder: placeholderBuilder,
        onDragStart: onDragStart,
        onDragUpdate: onDragUpdate,

        // how to determine the
        childrenDelegate: SliverChildBuilderDelegate(
          (BuildContext context, int index) {
            Widget child = itemBuilder(context, index);
            assert(() {
              if (child.key == null) {
                throw FlutterError(
                  'Every item of ReorderableGridView must have a key.',
                );
              }
              return true;
            }());
            return ReorderableItemView(
              key: child.key!,
              index: index,
              child: child,
            );
          },
          childCount: itemCount,
          addAutomaticKeepAlives: addAutomaticKeepAlives,
          addRepaintBoundaries: addRepaintBoundaries,
          addSemanticIndexes: addSemanticIndexes,
        ),

        gridDelegate: gridDelegate,
        reverse: reverse,
        controller: controller,
        primary: primary,
        physics: physics,
        shrinkWrap: shrinkWrap,
        padding: padding,
        cacheExtent: cacheExtent,
        semanticChildCount: semanticChildCount ?? itemCount,
        dragStartBehavior: dragStartBehavior,
        keyboardDismissBehavior: keyboardDismissBehavior,
        restorationId: restorationId,
        clipBehavior: clipBehavior,
        dragStartDelay: dragStartDelay,
        dragEnabled: dragEnabled,
        restrictDragScope: restrictDragScope,
      );