Box constructor

Box({
  1. Object? child,
  2. List<Object?> children = const [],
  3. String tag = 'div',
  4. Object? width,
  5. Object? height,
  6. Object? padding,
  7. Object? margin,
  8. Object? background,
  9. Object? radius,
  10. Border? border,
  11. String? className,
  12. Map<String, Object?> props = const {},
  13. Map<String, Object?> style = const {},
  14. DartStyle? dartStyle,
})

Creates a box using tag and optional style shortcuts.

Implementation

Box({
  Object? child,
  List<Object?> children = const [],
  String tag = 'div',
  Object? width,
  Object? height,
  Object? padding,
  Object? margin,
  Object? background,
  Object? radius,
  Border? border,
  String? className,
  Map<String, Object?> props = const {},
  Map<String, Object?> style = const {},
  DartStyle? dartStyle,
}) : super(
       tag,
       props: mergeComponentProps(
         props,
         className: className,
         dartStyle: DartStyle(
           width: width,
           height: height,
           padding: padding == null ? null : EdgeInsets.all(padding),
           margin: margin == null ? null : EdgeInsets.all(margin),
           background: background,
           radius: radius,
           border: border,
         ).merge(dartStyle),
         style: style,
       ),
       children: normalizeChildren(child, children),
     );