颤振延迟动画显示无动画曲线

时间:2019-06-05 10:59:07

标签: flutter dart

我目前在动画延迟方面遇到问题。我使用FadeTransition小部件淡入页面的内容并淡出一些显示在开头的文本。 它可以工作,但是动画非常突然。

编辑:没关系。间隔值,其中> 1.0。下面的代码现在可以正常工作。

class _SinglePhotoState extends State<SinglePhoto> with TickerProviderStateMixin{

  AnimationController controller, controllerText;
  Animation<double> delayedAnimation, delayedText;

  @override
  void initState() {
    // TODO: implement initState
    super.initState();
    controller = AnimationController(duration: const Duration(seconds: 5), vsync: this);
    controllerText = AnimationController(duration: const Duration(seconds: 3), vsync: this);
    delayedText = Tween(begin: 1.0, end: 0.0).animate(
       CurvedAnimation(
          parent: controllerText,
          curve: Interval(0.25, 0.5, curve: Curves.easeIn)
       ));
    delayedAnimation = Tween(begin: 0.0, end: 1.0).animate(
       CurvedAnimation(
          parent: controller,
          curve: Interval(0.5, 1.0, curve: Curves.easeIn)
       ));

        controllerText.forward();
        controller.forward();
    }

1 个答案:

答案 0 :(得分:0)

配置文件或发行版中的动画也很突然吗?

我注意到我的动画在调试模式下也非常不一致且不稳定。 但是在Profile构建中,一切都很好。