flutter圆形进度条如何反方向增加进度?

flutter app
我是用ele_progress一个flutter插件做的圆形进度条,和饿了么UI类似。
正常增加进度是顺时针增加,但是我现在有个需求,需要支持逆时针增加这个进度,把进度条颜色和背景颜色对调这个试过了,效果不好,因为这个进度是有圆角的,有什么方法可以让圆形进度条逆时针增加进度吗?

阅读 2.9k
2 个回答

外面套个 div,div 上 transform:rotatey(180deg)

可以使用 RotationTransition

先 declare turnsTween:

  final Tween<double> turnsTween = Tween<double>(
    begin: 1,
    end: 0,
  );

然后 wrap 在 EProgress 如下

 Container(
    height: 100,
    width: 100,
    child: RotationTransition(
    turns: turnsTween.animate(_controller),
    child: EProgress(
      textInside: false,
      showText: false,
      direction: Axis.horizontal,
      progress: _animation.value,
      type: ProgressType.circle,
      backgroundColor: Colors.grey,
     ),
   )),
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题