Divider constructor

Divider({
  1. bool vertical = false,
  2. String color = '#e4e7ec',
  3. Object thickness = 1,
  4. Object? length,
  5. String? className,
  6. Map<String, Object?> props = const {},
  7. Map<String, Object?> style = const {},
  8. DartStyle? dartStyle,
})

Creates a divider with separator semantics.

Implementation

Divider({
  bool vertical = false,
  String color = '#e4e7ec',
  Object thickness = 1,
  Object? length,
  String? className,
  Map<String, Object?> props = const {},
  Map<String, Object?> style = const {},
  DartStyle? dartStyle,
}) : super(
        'div',
        props: mergeComponentProps(
          {
            ...props,
            'role': props['role'] ?? 'separator',
            'aria-orientation': vertical ? 'vertical' : 'horizontal',
          },
          className: className,
          defaultStyle: vertical
              ? {
                  'width': cssValue(thickness),
                  'height': length == null ? 'auto' : cssValue(length),
                  'background': color,
                  'align-self': 'stretch',
                }
              : {
                  'height': cssValue(thickness),
                  'width': length == null ? '100%' : cssValue(length),
                  'background': color,
                },
          dartStyle: dartStyle,
          style: style,
        ),
      );