drawTagShape static method

CustomPainter? drawTagShape({
  1. required FlutterTagShape shape,
  2. Color? color,
  3. FlutterTagGradient? tagGradient,
  4. FlutterTagGradient? borderGradient,
  5. BorderSide? borderSide,
})

Implementation

static CustomPainter? drawTagShape({
  required FlutterTagShape shape,
  Color? color,
  FlutterTagGradient? tagGradient,
  FlutterTagGradient? borderGradient,
  BorderSide? borderSide,
}) {
  final painterFactories = {
    FlutterTagShape.cloud: () => FlutterCloudTagShapePainter(
          color: color ?? Colors.blue,
          tagGradient: tagGradient,
          borderSide: borderSide,
          borderGradient: borderGradient,
        ),
    FlutterTagShape.star: () => FlutterStarTagShapePainter(
          color: color ?? Colors.blue,
          tagGradient: tagGradient,
          borderSide: borderSide,
          borderGradient: borderGradient,
        ),
    FlutterTagShape.diamond: () => FlutterDiamondTagShapePainter(
          color: color ?? Colors.blue,
          tagGradient: tagGradient,
          borderSide: borderSide,
          borderGradient: borderGradient,
        ),
    FlutterTagShape.hexagon: () => FlutterHexagonTagShapePainter(
          color: color ?? Colors.blue,
          tagGradient: tagGradient,
          borderSide: borderSide,
          borderGradient: borderGradient,
        ),
    FlutterTagShape.pentagon: () => FlutterPentagonTagShapePainter(
          color: color ?? Colors.blue,
          tagGradient: tagGradient,
          borderSide: borderSide,
          borderGradient: borderGradient,
        ),
    // Add other shapes here if needed
  };

  return painterFactories[shape]?.call();
}