ResponsiveGrid constructor
const
ResponsiveGrid({
- Key? key,
- List<
Widget> ? children, - IndexedWidgetBuilder? itemBuilder,
- int? itemCount,
- double spacing = 10,
- double runSpacing = 10,
- double? childAspectRatio,
- EdgeInsetsGeometry? padding,
- int? watch,
- int? mobile,
- int? tablet,
- int? smallDesktop,
- int? desktop,
- int? largeDesktop,
- double? minItemWidth,
- bool scaleMinItemWidth = true,
- bool useSliver = false,
- bool shrinkWrap = false,
- ScrollPhysics? physics,
Implementation
const ResponsiveGrid({
super.key,
this.children,
this.itemBuilder,
this.itemCount,
this.spacing = 10,
this.runSpacing = 10,
this.childAspectRatio,
this.padding,
this.watch,
this.mobile,
this.tablet,
this.smallDesktop,
this.desktop,
this.largeDesktop,
this.minItemWidth,
this.scaleMinItemWidth = true,
this.useSliver = false,
this.shrinkWrap = false,
this.physics,
}) : assert(
(children != null) != (itemBuilder != null),
"Provide either 'children' OR 'itemBuilder', not both.",
),
assert(
itemBuilder == null || itemCount != null,
"If 'itemBuilder' is used, 'itemCount' must be provided.",
),
assert(itemCount == null || itemCount >= 0, "itemCount must be >= 0"),
assert(spacing >= 0, "Spacing must be positive"),
assert(minItemWidth == null || minItemWidth > 0,
"minItemWidth must be > 0");