getPaintStyle function

PaintStyle getPaintStyle(
  1. Attributes attributes,
  2. bool hollow,
  3. double strokeWidth,
  4. Rect? gradientBounds,
  5. List<double>? dash,
)

Implementation

PaintStyle getPaintStyle(
  Attributes attributes,
  bool hollow,
  double strokeWidth,
  Rect? gradientBounds,
  List<double>? dash,
) {
  if (hollow) {
    if (attributes.gradient != null) {
      return PaintStyle(
        strokeGradient: attributes.gradient,
        strokeWidth: strokeWidth,
        elevation: attributes.elevation,
        gradientBounds: gradientBounds,
        dash: dash,
      );
    } else {
      return PaintStyle(
        strokeColor: attributes.color,
        strokeWidth: strokeWidth,
        elevation: attributes.elevation,
        gradientBounds: gradientBounds,
        dash: dash,
      );
    }
  } else {
    if (attributes.gradient != null) {
      return PaintStyle(
        fillGradient: attributes.gradient,
        elevation: attributes.elevation,
        gradientBounds: gradientBounds,
        dash: dash,
      );
    } else {
      return PaintStyle(
        fillColor: attributes.color,
        elevation: attributes.elevation,
        gradientBounds: gradientBounds,
        dash: dash,
      );
    }
  }
}