简体   繁体   English

如何使用自定义画家显示圆的一部分?

[英]How to show a part of the circle using custom painter?

So I have this card widget to create所以我有这个卡片小部件来创建在此处输入图像描述

how can I create the golden part of the circle using custom painter?.I can create a full circle but how can I just display that small part of the circle and hide the rest?如何使用自定义画家创建圆的黄金部分?我可以创建一个完整的圆,但如何只显示圆的一小部分并隐藏 rest?

Card(
        color: Colors.grey,
        child: Row(
          children: [
            Column(
              children: [
                Padding(
                  padding: const EdgeInsets.all(8.0),
                  child: Container(
                      width: MediaQuery.of(context).size.width * 0.4,
                      child: Text(
                          "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cursus sed eros ullamcorper.")),
                ),
                Padding(
                  padding: const EdgeInsets.all(8.0),
                  child: Text("*Conditions Apply"),
                )
              ],
            ),
            Container(
              color: Colors.pink,
              width: 200,
              height: 300,
              child: CustomPaint(
                painter: ArcPainter(),
              ),
            )
          ],
        )));

You can use ArcShape using the shape_of_view package.您可以使用ArcShape来使用ArcShape

ShapeOfView(
  shape: ArcShape(
    direction: ArcDirection.Outside,
    height: 20,
    position: ArcPosition.Bottom
  ),
  child: ...
)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM