小编Shw*_*eta的帖子

如何在Flutter中制作带有波浪边框的圆圈来显示图像?

我想制作带有波浪边框的圆形容器。为此,我使用了flutter_custom_clippers 2.0.0包的StarClipper并进行了一些更改。但是,我无法让它如我所愿。有人可以帮忙吗?

如果有任何其他方式可用,请告诉我。先感谢您 :)

这是我的代码:

import 'dart:math' as math;

import 'package:flutter/widgets.dart';

/// Clip widget in star shape
class StarClipper extends CustomClipper<Path> {
  StarClipper(this.numberOfPoints);

  /// The number of points of the star
  final int numberOfPoints;

  late int counter = 0;

  @override
  Path getClip(Size size) {
    double width = size.width;

    double halfWidth = width / 2;

    double bigRadius = halfWidth;

    double radius = halfWidth / 1.11;

    double degreesPerStep = _degToRad(360 / numberOfPoints) as double;

    double halfDegreesPerStep = degreesPerStep …
Run Code Online (Sandbox Code Playgroud)

mobile flutter

5
推荐指数
1
解决办法
303
查看次数

标签 统计

flutter ×1

mobile ×1