微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

颤动 - 制作反向线性进度指示器

如何解决颤动 - 制作反向线性进度指示器

我想做一个如下图所示的反向线性进度指标加载

reverse linearprogressindicator

我尝试使用 animationController 使负载恢复原状。但不太流畅,方向也略有不同。有谁知道如何使它看起来像那样? 看下面的视频

current reverse loading

这里附上一段代码

@override
  void initState() {
    // Todo: implement initState
    super.initState();
    controller = AnimationController(
        duration: const Duration(milliseconds: 1000),vsync: this);
    animation = Tween(begin: 0.0,end: 1.0).animate(controller)
      ..addListener(() {
        setState(() {
          // the state that has changed here is the animation object’s value
        });
      });
    controller.repeat(reverse: true);
  }

Container(
     height: MediaQuery.of(context).size.height * .005,child: LinearProgressIndicator(
     value: animation.value,// minHeight: 1.0,// value: 2.0,backgroundColor: Colors.white24,valueColor: AlwaysstoppedAnimation<Color>(Colors.red),semanticslabel: "Finding incoming"))

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。