Pet*_*tro 2 flutter flutter-layout
我正在遵循本动画指南:https ://mightytechno.com/flutter-glow-pulse-animation/
当我去使用this它时,它不会让我通过。我无法编译并且 flutter clean 什么也不做。我可以传递什么对象来消除此错误?
void initState() {
getSharedPrefs();
_animationController = AnimationController(vsync: this, duration: Duration(seconds: 2));
_animationController.repeat(reverse: true);
_animation = Tween(begin: 2.0,end: 15.0).animate(_animationController)..addListener((){
setState(() {
});
});
Run Code Online (Sandbox Code Playgroud)
扩展SingleTickerProviderStateMixin解决了这个问题:
class Social4state extends State<UserProfilePage> with SingleTickerProviderStateMixin{
| 归档时间: |
|
| 查看次数: |
1504 次 |
| 最近记录: |