0

我想进行反向线性iprogressindicator加载,如下所示

反向线性进度指示器

我尝试使用 animationController 使负载回到从头开始。但不太平滑,方向略有不同。有谁知道如何使它看起来像这样?看下面的视频

电流反向加载

在这里我附上一段代码

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

0 回答 0