Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/flutter/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/dart/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Flutter 颤振:光滑的圆角_Flutter_Dart_Button - Fatal编程技术网

Flutter 颤振:光滑的圆角

Flutter 颤振:光滑的圆角,flutter,dart,button,Flutter,Dart,Button,我想知道如何在颤振中制造一个平滑的圆角。我发现了与iOS方法类似的链接,但它并没有帮助我找到解决颤振方法的方法。我认为这是一种方式,但它不是我正在寻找的形状。我认为某种裁剪器应该可以工作。您可以尝试以下代码 ClipRRect 边界半径: 边界半径。圆形15.0, child://需要舍入的小部件。 有关更多信息,您可以检查对于颤振,没有自然的方法可以做到这一点。如果您真的想实现这一点,请使用中使用的技术,即使用堆栈小部件将正方形与圆形重叠。如下所示: Stack(children: [

我想知道如何在颤振中制造一个平滑的圆角。我发现了与iOS方法类似的链接,但它并没有帮助我找到解决颤振方法的方法。我认为这是一种方式,但它不是我正在寻找的形状。我认为某种裁剪器应该可以工作。

您可以尝试以下代码

ClipRRect 边界半径: 边界半径。圆形15.0, child://需要舍入的小部件。
有关更多信息,您可以检查对于颤振,没有自然的方法可以做到这一点。如果您真的想实现这一点,请使用中使用的技术,即使用堆栈小部件将正方形与圆形重叠。如下所示:

Stack(children: [
          Container(
              height: 100,
              width: 100,
              decoration: BoxDecoration(
                shape: BoxShape.circle,
                color: Colors.amber,
              )),
          Container(
            height: 100,
            width: 100,
            decoration: BoxDecoration(
              color: Colors.amber,
              borderRadius: BorderRadius.all(Radius.circular(16)),
            ),
          ),
        ]),
这将创建一个方形,看起来像:


你可能需要摆弄正方形和圆形的高度和宽度,但你明白了。

平滑圆角?你是说圆角?不,圆角半径平滑,有类似问题的链接。以下是解释剪辑。hardEdge听起来不像平滑逼近剪辑。hardEdge是可选的。你可以离开这一行…尝试不使用clip.hardedge我已经编辑了代码…问题是边缘之间要平滑过渡,否则我知道要制作更圆的角。