HandDrawnDivider class

A horizontal or vertical divider rendered with a hand-drawn, sketchy stroke.

Behaves like Flutter's built-in Divider but renders a jittered line instead of a perfectly straight one.

Column(
  children: [
    Text('Section A'),
    HandDrawnDivider(color: Colors.grey),
    Text('Section B'),
  ],
)

For a vertical divider, set direction to Axis.vertical:

Row(
  children: [
    Text('Left'),
    HandDrawnDivider(direction: Axis.vertical, height: 40),
    Text('Right'),
  ],
)
Inheritance

Constructors

HandDrawnDivider({Key? key, Axis direction = Axis.horizontal, Color color = Colors.black54, double thickness = HandDrawnDefaults.dividerThickness, double irregularity = HandDrawnDefaults.dividerIrregularity, int segments = HandDrawnDefaults.dividerSegments, int seed = HandDrawnDefaults.seed, double? width, double? height, double indent = 0.0, double endIndent = 0.0})
Creates a hand-drawn divider.
const

Properties

color Color
The color of the hand-drawn stroke.
final
direction Axis
Whether this divider runs horizontally or vertically.
final
endIndent double
Empty space after the end of the divider stroke.
final
hashCode int
The hash code for this object.
no setterinherited
height double?
The length of the divider line for vertical dividers.
final
indent double
Empty space before the start of the divider stroke.
final
irregularity double
The roughness of the hand-drawn wobble.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
seed int
The random seed for deterministic stroke generation.
final
segments int
The number of linear segments used to draw the line.
final
thickness double
The width of the stroke in logical pixels.
final
width double?
The length of the divider line for horizontal dividers.
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
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