VDivider class
A flexible divider component for separating content with customizable spacing and styling.
VDivider provides a visual separator line that can be displayed horizontally or vertically. It supports customizable margins and color variants to match different design contexts. The divider automatically adapts its padding based on orientation (horizontal or vertical).
The widget uses two enums for configuration:
- VDividerMargin: Controls spacing around the divider (none, extraSmall, small, medium, large, extraLarge)
- VDividerVariant: Controls divider color (primary, secondary, destructive)
Parameters:
- margin: Space before and after the divider line (defaults to medium = 16px)
- variant: Color style of the divider (defaults to secondary)
- vertical: Whether the divider should be vertical instead of horizontal (defaults to false)
Note: When using a vertical divider, wrap it in a SizedBox to constrain its height, otherwise it will expand to fill available space.
Example:
// Horizontal divider with medium spacing
VDivider(
margin: VDividerMargin.medium,
variant: VDividerVariant.secondary,
)
// Vertical divider wrapped in SizedBox for proper constraint
SizedBox(
height: 100,
child: VDivider(
vertical: true,
margin: VDividerMargin.small,
),
)
// Destructive divider with large spacing
VDivider(
margin: VDividerMargin.large,
variant: VDividerVariant.destructive,
)
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- VDivider
Constructors
- VDivider({Key? key, VDividerMargin margin = VDividerMargin.medium, VDividerVariant variant = VDividerVariant.secondary, bool vertical = false})
-
const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- margin → VDividerMargin
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- variant → VDividerVariant
-
final
- vertical → bool
-
final
Methods
-
build(
BuildContext context) → Widget -
Describes the part of the user interface represented by this widget.
override
-
createElement(
) → StatelessElement -
Creates a StatelessElement to manage this widget's location in the tree.
inherited
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toDividerStyle(
FThemeData theme) → FDividerStyleDelta -
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited