MasonryGridView.custom constructor

const MasonryGridView.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. required SliverSimpleGridDelegate gridDelegate,
  10. required SliverChildDelegate childrenDelegate,
  11. double mainAxisSpacing = 0.0,
  12. double crossAxisSpacing = 0.0,
  13. double? cacheExtent,
  14. int? semanticChildCount,
  15. DragStartBehavior dragStartBehavior = DragStartBehavior.start,
  16. ScrollViewKeyboardDismissBehavior keyboardDismissBehavior = ScrollViewKeyboardDismissBehavior.manual,
  17. String? restorationId,
  18. Clip clipBehavior = Clip.hardEdge,
})

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

To use an IndexedWidgetBuilder callback to build children, either use a SliverChildBuilderDelegate or use MasonryGridView.builder, MasonryGridView.count or MasonryGridView.extent constructors.

Implementation

const MasonryGridView.custom({
  Key? key,
  Axis scrollDirection = Axis.vertical,
  bool reverse = false,
  ScrollController? controller,
  bool? primary,
  ScrollPhysics? physics,
  bool shrinkWrap = false,
  EdgeInsetsGeometry? padding,
  required this.gridDelegate,
  required this.childrenDelegate,
  this.mainAxisSpacing = 0.0,
  this.crossAxisSpacing = 0.0,
  double? cacheExtent,
  int? semanticChildCount,
  DragStartBehavior dragStartBehavior = DragStartBehavior.start,
  ScrollViewKeyboardDismissBehavior keyboardDismissBehavior =
      ScrollViewKeyboardDismissBehavior.manual,
  String? restorationId,
  Clip clipBehavior = Clip.hardEdge,
}) : super(
        key: key,
        scrollDirection: scrollDirection,
        reverse: reverse,
        controller: controller,
        primary: primary,
        physics: physics,
        shrinkWrap: shrinkWrap,
        padding: padding,
        cacheExtent: cacheExtent,
        semanticChildCount: semanticChildCount,
        dragStartBehavior: dragStartBehavior,
        keyboardDismissBehavior: keyboardDismissBehavior,
        restorationId: restorationId,
        clipBehavior: clipBehavior,
      );