LinePattern.diagonal constructor

LinePattern.diagonal({
  1. double strokeWidth = 2,
  2. double spacing = 8,
  3. Color backgroundColor = const Color(0x00000000),
  4. Color foregroundColor = const Color(0xFF000000),
  5. bool reverse = false,
})

Creates a diagonal line pattern (45 degrees).

Implementation

factory LinePattern.diagonal({
  double strokeWidth = 2,
  double spacing = 8,
  Color backgroundColor = const Color(0x00000000),
  Color foregroundColor = const Color(0xFF000000),
  bool reverse = false,
}) {
  return LinePattern(
    strokeWidth: strokeWidth,
    spacing: spacing,
    angle: reverse ? -math.pi / 4 : math.pi / 4,
    backgroundColor: backgroundColor,
    foregroundColor: foregroundColor,
  );
}