DashedDecoration constructor

const DashedDecoration({
  1. Gradient? gradient,
  2. Color? color,
  3. double step = 2.0,
  4. double span = 2.0,
  5. int pointCount = 0,
  6. double? pointWidth,
  7. Radius? radius,
  8. double strokeWidth = 1.0,
})

A custom Decoration that draws a dashed (or dotted) border around a widget such as a Container, Card, or any Box widget.

Supports:

  • Solid dashes and dot-dash patterns
  • Configurable spacing, thickness, corner radius
  • Optional gradient or solid color

Example:

Container(
  decoration: DashedDecoration(
    step: 4,
    span: 2,
    strokeWidth: 1,
    radius: Radius.circular(12),
    color: Colors.blue,
  ),
)

Implementation

const DashedDecoration({
  this.gradient,
  this.color,
  this.step = 2.0,
  this.span = 2.0,
  this.pointCount = 0,
  this.pointWidth,
  this.radius,
  this.strokeWidth = 1.0,
});