ReorderableGridView.count constructor
ReorderableGridView.count({
- Key? key,
- required ReorderCallback onReorder,
- DragWidgetBuilder? dragWidgetBuilder,
- DragWidgetBuilderV2? dragWidgetBuilderV2,
- ScrollSpeedController? scrollSpeedController,
- PlaceholderBuilder? placeholderBuilder,
- OnDragStart? onDragStart,
- OnDragUpdate? onDragUpdate,
- 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,
- 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,
);
}