GridView.custom constructor Null safety
- {Key? key,
- Axis scrollDirection = Axis.vertical,
- bool reverse = false,
- ScrollController? controller,
- bool? primary,
- ScrollPhysics? physics,
- bool shrinkWrap = false,
- EdgeInsetsGeometry? padding,
- required SliverGridDelegate gridDelegate,
- required SliverChildDelegate childrenDelegate,
- double? cacheExtent,
- int? semanticChildCount,
- DragStartBehavior dragStartBehavior = DragStartBehavior.start,
- ScrollViewKeyboardDismissBehavior keyboardDismissBehavior = ScrollViewKeyboardDismissBehavior.manual,
- String? restorationId,
- 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
const GridView.custom({
super.key,
super.scrollDirection,
super.reverse,
super.controller,
super.primary,
super.physics,
super.shrinkWrap,
super.padding,
required this.gridDelegate,
required this.childrenDelegate,
super.cacheExtent,
super.semanticChildCount,
super.dragStartBehavior,
super.keyboardDismissBehavior,
super.restorationId,
super.clipBehavior,
}) : assert(gridDelegate != null),
assert(childrenDelegate != null);