颤动:光滑的圆角

Ste*_*pan 3 button dart flutter

我想知道如何在 Flutter 中制作平滑的圆角。我发现了一个与 iOS 方法类似的链接 - smooth roundedcorns in swift但它并没有帮助我找到 Flutter 方法的解决方案。我认为ContinuousRectangleBorder就是这样,但这不是我正在寻找的形状。我认为某种剪刀应该有用。

小智 12

我发布了一个可能对您有帮助的专用包:figma_squircle

Container(
    height: 100,
    width: 100,
    decoration: ShapeDecoration(
        color: Colors.red.withOpacity(0.75),
        shape: SmoothRectangleBorder(
            borderRadius: SmoothBorderRadius(
              cornerRadius: 10,
              cornerSmoothing: 0.5,
            ),
        ),
    ),
)
Run Code Online (Sandbox Code Playgroud)