我想把这个设计翻成垂直的.在这里曲线的位置在底部,我希望这条曲线位于顶部.那么,我应该更改哪个值呢?我已经在下面分享了我的照片和代码.

enter image description here

class ClipPathClass extends CustomClipper<Path> {

  @override
  Path getClip(Size size) {
    Path path = Path();
    path.lineTo(0.0, size.height);
    double x = 0;
    double y = size.height;
    double yControlPoint = size.height * .88;
    double increment = size.width / 15;

    while (x < size.width) {
      path.quadraticBezierTo(
          x + increment / 2, yControlPoint, x + increment, y);
      x += increment;
    }

    path.lineTo(size.width, 0.0);

    path.close();
    return path;
  }

  @override
  bool shouldReclip(CustomClipper<Path> oldClipper) => false;
}

推荐答案

class ClipPathClass extends CustomClipper<Path> {
  @override
  Path getClip(Size size) {
    Path path = Path();
    path.lineTo(0.0, 0);

    double x = 0;
    double y = 0;
    double yControlPoint = size.height - size.height * .88;
    double increment = size.width / 15;

    while (x < size.width) {
      path.quadraticBezierTo(
          x + increment / 2, yControlPoint, x + increment, y);
      x += increment;
    }

    path.lineTo(size.width, size.height);
    path.lineTo(0, size.height);

    path.close();
    return path;
  }

  @override
  bool shouldReclip(CustomClipper<Path> oldClipper) => false;
}

Flutter相关问答推荐

创建后检索FiRestore文档ID

使用现有Map方法对子类克隆方法的逻辑进行Dart标准化

运行调试flutter应用程序时出错:B/BL超出范围(最大+/-128MB)到'';

Dart 和 flutter 错误无法在您的 PATH 中找到 git

无法在 Flutter 项目中安装最新版本的 image_picker

在 Flutter 中,SpinEdit 叫什么?

如何从另一个页面访问 Firebase 值?

如何使用 riverpod_annotation 创建非自动处置提供程序?

应用程序和应用程序内的 webview 之间的单点登录

Flutter sliver 持久化

访问 AsyncSnapshot 中的嵌套属性

在 flutter 的另一个类中使用变量值

对话框打开时如何使背景模糊?

容器在发布模式下显示灰色框(抖动)

如何获取 android 和 Ios (flutter) 的 CircularProgress 指示器?

Flutter 中父容器顶部的 Gridview 间距额外区域

如何在Flutter 中根据其父小部件高度设置图标按钮飞溅半径

解密 Modulr 安全令牌

Flutter 平台通道将多数据传递给 windows 功能

Flutter_riverpod 安装时出现问题