Separator
A Separator is a visual element that divides content into distinct sections. Use Separators to group related information, define boundaries, and improve readability, making interfaces easier to scan and navigate.
Common alternative names:
Divider, line, border
Variants
Section titled “Variants”Separator variants control how strong or subtle the divider appears.
Cell Divider
Section titled “Cell Divider”Used to separate closely related items, such as list entries or form fields.
Separator( variant: SeparatorVariant.solid,)Module Divider
Section titled “Module Divider”Used to separate larger groups of content, such as sections on a page.
Separator( thickness: 8)Dashed
Section titled “Dashed”A broken line for lighter, less prominent division.
Separator( variant: SeparatorVariant.dashed,)Dotted
Section titled “Dotted”A subtle dotted line for minimal visual interruption.
Separator( variant: SeparatorVariant.dotted,)Center
Section titled “Center”Label is centered within the divider.
Separator( label: 'Label', labelPosition: LabelPosition.center,)Leading
Section titled “Leading”Label appears at the start of the divider.
Separator( label: 'Label', labelPosition: LabelPosition.leading,)Trailing
Section titled “Trailing”Label appears at the end of the divider.
Separator( label: 'Label', labelPosition: LabelPosition.trailing,)Vertical
Section titled “Vertical”Divides vertically stacked content (e.g., sidebars, columns).
Separator( orientation: Axis.vertical,)Custom Colors
Section titled “Custom Colors”Separator( variant: SeparatorVariant.dashed, color: Colors.purple,)Separator( variant: SeparatorVariant.dotted, color: Colors.teal, dotSpacing: 12, dotRadius: 2,)Properties
Section titled “Properties”| Property | Type | Description |
|---|---|---|
variant | SeparatorVariant | The visual style of the separator. |
orientation | Axis | The directional layout of the separator. |
label | String? | Optional text label to display with the separator. |
labelPosition | LabelPosition | Position of the label along the separator. |
color | Color? | Custom color for the separator line. |
thickness | double? | Custom thickness for the separator line. |
labelStyle | TextStyle? | Custom text style for the label. |
dashPattern | List<double> | Pattern for dashed variant [dashLength, gapLength]. |
dotSpacing | double | Spacing between dots for dotted variant. |
dotRadius | double | Radius of dots for dotted variant. |
padding | EdgeInsetsGeometry? | Padding around the entire separator. |