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

时间:2021-03-29 01:56:40

标签: flutter widget reverse progress-indicator

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

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"))

0 个答案:

没有答案
相关问题