Wrap constructor

Wrap({
  1. Object? child,
  2. List<Object?> children = const [],
  3. Object? gap,
  4. AlignItems? alignItems,
  5. JustifyContent? justifyContent,
  6. String? className,
  7. Map<String, Object?> props = const {},
  8. Map<String, Object?> style = const {},
  9. DartStyle? dartStyle,
})

Creates a wrapping flex layout.

Implementation

Wrap({
  Object? child,
  List<Object?> children = const [],
  Object? gap,
  AlignItems? alignItems,
  JustifyContent? justifyContent,
  String? className,
  Map<String, Object?> props = const {},
  Map<String, Object?> style = const {},
  DartStyle? dartStyle,
}) : super(
       'div',
       props: mergeComponentProps(
         props,
         className: className,
         defaultStyle: {
           'display': 'flex',
           'flex-wrap': cssValue(FlexWrap.wrap, unitlessNumber: true),
           if (gap != null) 'gap': cssValue(gap),
           if (alignItems != null) 'align-items': alignItems.css,
           if (justifyContent != null) 'justify-content': justifyContent.css,
         },
         dartStyle: dartStyle,
         style: style,
       ),
       children: normalizeChildren(child, children),
     );