Center constructor

Center({
  1. Object? child,
  2. List<Object?> children = const [],
  3. bool inline = false,
  4. String? className,
  5. Map<String, Object?> props = const {},
  6. Map<String, Object?> style = const {},
  7. DartStyle? dartStyle,
})

Creates a centering container.

Implementation

Center({
  Object? child,
  List<Object?> children = const [],
  bool inline = false,
  String? className,
  Map<String, Object?> props = const {},
  Map<String, Object?> style = const {},
  DartStyle? dartStyle,
}) : super(
       'div',
       props: mergeComponentProps(
         props,
         className: className,
         defaultStyle: {
           'display': inline ? 'inline-flex' : 'flex',
           'align-items': 'center',
           'justify-content': 'center',
         },
         dartStyle: dartStyle,
         style: style,
       ),
       children: normalizeChildren(child, children),
     );