PaintStyle constructor
PaintStyle({
- Color? fillColor,
- Gradient? fillGradient,
- Shader? fillShader,
- Color? strokeColor,
- Gradient? strokeGradient,
- Shader? strokeShader,
- Rect? gradientBounds,
- BlendMode? blendMode,
- double? strokeWidth,
- StrokeCap? strokeCap,
- StrokeJoin? strokeJoin,
- double? strokeMiterLimit,
- double? elevation,
- Color? shadowColor,
- List<
double> ? dash, - DashOffset? dashOffset,
Creates a paint style.
Implementation
PaintStyle({
this.fillColor,
this.fillGradient,
this.fillShader,
this.strokeColor,
this.strokeGradient,
this.strokeShader,
this.gradientBounds,
this.blendMode,
this.strokeWidth,
this.strokeCap,
this.strokeJoin,
this.strokeMiterLimit,
this.elevation,
Color? shadowColor,
this.dash,
this.dashOffset,
}) : assert(
isSingle([fillColor, fillGradient, fillShader], allowNone: true)),
assert(isSingle([strokeColor, strokeGradient, strokeShader],
allowNone: true)),
assert(strokeColor != null ||
strokeGradient != null ||
strokeShader != null ||
(strokeWidth == null ||
strokeCap == null ||
strokeJoin == null ||
strokeMiterLimit == null)),
assert(elevation != null || shadowColor == null),
assert(dash != null || dashOffset == null),
shadowColor = elevation == null
? null
: fillColor ?? (strokeColor ?? const Color(0xFF000000));