defaultTools static method

List<DefToolItem> defaultTools(
  1. Type currType,
  2. DrawingController controller
)

默认工具项列表

Implementation

static List<DefToolItem> defaultTools(
    Type currType, DrawingController controller) {
  return <DefToolItem>[
    DefToolItem(
        isActive: currType == SimpleLine,
        icon: CupertinoIcons.pencil,
        onTap: () => controller.setPaintContent(SimpleLine())),
    DefToolItem(
        isActive: currType == SmoothLine,
        icon: Icons.brush,
        onTap: () => controller.setPaintContent(SmoothLine())),
    DefToolItem(
        isActive: currType == StraightLine,
        icon: Icons.show_chart,
        onTap: () => controller.setPaintContent(StraightLine())),
    DefToolItem(
        isActive: currType == Rectangle,
        icon: CupertinoIcons.stop,
        onTap: () => controller.setPaintContent(Rectangle())),
    DefToolItem(
        isActive: currType == Circle,
        icon: CupertinoIcons.circle,
        onTap: () => controller.setPaintContent(Circle())),
    DefToolItem(
        isActive: currType == Eraser,
        icon: CupertinoIcons.bandage,
        onTap: () => controller.setPaintContent(Eraser(color: Colors.white))),
  ];
}