0

我正在使用drawDRRect绘制矩形,并希望内部颜色Colors.green和外部颜色Colors.blue如何控制Paint()

 canvas.drawDRRect(
        RRect.fromRectAndCorners(
            Rect.fromLTWH(
              0,
              0,
              context.size.width,
              36,
            ),
            bottomLeft: Radius.circular(10),
            bottomRight: Radius.circular(10),
            topLeft: Radius.circular(10),
            topRight: Radius.circular(10)),
        RRect.fromRectAndCorners(
            Rect.fromLTRB(canvasStartPosition.dx, 0, canvasEndPosition.dx, 0)),
        Paint()..color = Colors.green);
4

1 回答 1

0
canvas.drawRRect(
        RRect.fromRectAndCorners(
          Rect.fromLTRB(
            0,
            0,
            canvasStartPosition.dx,
            36,
          ),
          bottomLeft: Radius.circular(10),
          topLeft: Radius.circular(10),
        ),
        new Paint()..color = Colors.blue);
    canvas.drawRRect(
        RRect.fromRectAndCorners(
          Rect.fromLTRB(
            canvasStartPosition.dx,
            0,
            canvasEndPosition.dx,
            36,
          ),
        ),
        new Paint()..color = Colors.green);
    canvas.drawRRect(
        RRect.fromRectAndCorners(
          Rect.fromLTRB(
            canvasEndPosition.dx,
            0,
            context.size.width,
            36,
          ),
          bottomLeft: Radius.circular(10),
          topLeft: Radius.circular(10),
        ),
        new Paint()..color = Colors.blue);
于 2020-06-26T08:13:25.237 回答