lineShaderStyle method

Graphics lineShaderStyle(
  1. Shader shader
)

Sets the shader for drawing strokes. Use after lineStyle to apply a shader into the current Paint.

If _holeMode is true, the method will do nothing and return this Graphics object.

Returns this Graphics object after setting the shader for strokes.

Implementation

Graphics lineShaderStyle(Shader shader) {
  if (_holeMode) {
    return this;
  }
  assert(_currentDrawing!.fill?.style == PaintingStyle.stroke);
  if (shader is DisplayShader) {
    assert(shader.shader != null);
    shader = shader.shader!;
  }
  _currentDrawing!.fill!.shader = shader;
  return this;
}