Grid constructor

Grid({
  1. Object? child,
  2. List<Object?> children = const [],
  3. String? columns,
  4. String? rows,
  5. Object? gap,
  6. String? alignItems,
  7. String? justifyItems,
  8. String? className,
  9. Map<String, Object?> props = const {},
  10. Map<String, Object?> style = const {},
  11. DartStyle? dartStyle,
})

Creates a grid around child content.

Implementation

Grid({
  Object? child,
  List<Object?> children = const [],
  String? columns,
  String? rows,
  Object? gap,
  String? alignItems,
  String? justifyItems,
  String? className,
  Map<String, Object?> props = const {},
  Map<String, Object?> style = const {},
  DartStyle? dartStyle,
}) : super(
       'div',
       props: mergeComponentProps(
         props,
         className: className,
         defaultStyle: {
           'display': 'grid',
           if (columns != null) 'grid-template-columns': columns,
           if (rows != null) 'grid-template-rows': rows,
           if (gap != null) 'gap': cssValue(gap),
           if (alignItems != null) 'align-items': alignItems,
           if (justifyItems != null) 'justify-items': justifyItems,
         },
         dartStyle: dartStyle,
         style: style,
       ),
       children: normalizeChildren(child, children),
     );