相关疑难解决方法(0)

具有自定义形状的颤振按钮-(三角形)

我已经创建了一个圆形按钮,在这种情况下RawMaterialButton,我正尝试使用CustomPaint它在其中心创建一个三角形,但这ShapesPainter并不是为ClearButton'. I tried other buttons but couldn't get any of them to acceptShapesPainter 类定义的。

RawMaterialButton(
          child: CustomPaint(
            painter: ShapesPainter(),
            child: Container(
              height: 40,
            ),
          ),
          onPressed: onPressed,
          constraints: BoxConstraints.tightFor(
            width: 90.0,
            height: 90.0,
          ),
          shape: RoundedRectangleBorder(),
          fillColor: Colors.transparent,
        )
Run Code Online (Sandbox Code Playgroud)

应该使用哪种按钮类型?ShapesPainter或者如何创建一个中心为三角形或其他形状的圆形按钮?

这是我尝试创建的按钮,如您所见,它基本上是一个带有三角形的圆形按钮。

在此处输入图片说明

dart flutter

1
推荐指数
2
解决办法
1355
查看次数

标签 统计

dart ×1

flutter ×1