GridPatternPainter constructor

const GridPatternPainter({
  1. required double spacing,
  2. required double lineThickness,
  3. required Color color,
  4. bool repeatPattern = true,
  5. Offset patternOffset = const Offset(0, 0),
})

Creates a grid pattern painter.

spacing is the spacing between grid lines in logical pixels. lineThickness is the thickness of grid lines in logical pixels. color is the color of the grid lines. repeatPattern is whether the pattern should repeat across the canvas. patternOffset is the offset from the top-left corner where the pattern starts.

Implementation

const GridPatternPainter({
  required this.spacing,
  required this.lineThickness,
  required this.color,
  this.repeatPattern = true,
  this.patternOffset = const Offset(0, 0),
}) : elementSize = lineThickness;