drawTagShape static method
CustomPainter?
drawTagShape({
- required FlutterTagShape shape,
- Color? color,
- FlutterTagGradient? tagGradient,
- FlutterTagGradient? borderGradient,
- 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();
}