GridView.custom constructor

GridView.custom({
  1. required ScrollViewProperties properties,
  2. Key? key,
  3. ScrollPhysics? physics,
  4. bool shrinkWrap = false,
  5. EdgeInsetsGeometry? padding,
  6. required SliverGridDelegate gridDelegate,
  7. required SliverChildDelegate childrenDelegate,
  8. double? cacheExtent,
  9. int? semanticChildCount,
  10. DragStartBehavior dragStartBehavior = DragStartBehavior.start,
  11. ScrollViewKeyboardDismissBehavior keyboardDismissBehavior = ScrollViewKeyboardDismissBehavior.manual,
  12. String? restorationId,
  13. Clip clipBehavior = Clip.hardEdge,
})

Creates a scrollable, 2D array of widgets with both a custom SliverGridDelegate and a custom SliverChildDelegate.

To use an IndexedWidgetBuilder callback to build children, either use a SliverChildBuilderDelegate or use the GridView.builder constructor.

The gridDelegate and childrenDelegate arguments must not be null.

Implementation

GridView.custom({
  required ScrollViewProperties properties,
  Key? key,
  ScrollPhysics? physics,
  bool shrinkWrap = false,
  EdgeInsetsGeometry? padding,
  required this.gridDelegate,
  required this.childrenDelegate,
  double? cacheExtent,
  int? semanticChildCount,
  DragStartBehavior dragStartBehavior = DragStartBehavior.start,
  ScrollViewKeyboardDismissBehavior keyboardDismissBehavior =
      ScrollViewKeyboardDismissBehavior.manual,
  String? restorationId,
  Clip clipBehavior = Clip.hardEdge,
})  : assert(gridDelegate != null),
      assert(childrenDelegate != null),
      super(
        properties: properties,
        key: key,
        physics: physics,
        shrinkWrap: shrinkWrap,
        padding: padding,
        cacheExtent: cacheExtent,
        semanticChildCount: semanticChildCount,
        dragStartBehavior: dragStartBehavior,
        keyboardDismissBehavior: keyboardDismissBehavior,
        restorationId: restorationId,
        clipBehavior: clipBehavior,
      );