问题描述
我在列表视图中有容器,只要在屏幕上看到其中一个容器超过75%,容器的高度就会从100增加到150。
但是如何使用动画在3秒内将容器从100扩展到150?
我是新手,请帮助我。
解决方法
使用AnimatedContainer
AnimatedContainer(
duration: Duration(seconds: 3),height: expand?150:100,)
参考:https://api.flutter.dev/flutter/widgets/AnimatedContainer-class.html