StaggeredGridView.custom constructor

const StaggeredGridView.custom({
  1. Key? key,
  2. Axis scrollDirection = Axis.vertical,
  3. bool reverse = false,
  4. ScrollController? controller,
  5. bool? primary,
  6. ScrollPhysics? physics,
  7. bool shrinkWrap = false,
  8. EdgeInsetsGeometry? padding,
  9. String? restorationId,
  10. required SliverStaggeredGridDelegate gridDelegate,
  11. required SliverChildDelegate childrenDelegate,
})

Creates a scrollable, 2D array of widgets with both a custom SliverStaggeredGridDelegate and a custom SliverVariableSizeChildDelegate.

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

The gridDelegate and childrenDelegate arguments must not be null.

Implementation

const StaggeredGridView.custom({
  Key? key,
  Axis scrollDirection = Axis.vertical,
  bool reverse = false,
  ScrollController? controller,
  bool? primary,
  ScrollPhysics? physics,
  bool shrinkWrap = false,
  EdgeInsetsGeometry? padding,
  String? restorationId,
  required this.gridDelegate,
  required this.childrenDelegate,
}) : super(
  key: key,
  scrollDirection: scrollDirection,
  reverse: reverse,
  controller: controller,
  primary: primary,
  physics: physics,
  shrinkWrap: shrinkWrap,
  padding: padding,
  restorationId: restorationId,
);