【发布时间】:2017-11-15 08:03:23
【问题描述】:
我正在尝试创建一个动画,将小部件“弹出”到前面并返回到它
import "package:flutter/material.dart";
class ScoreCounter extends StatefulWidget {
@override
_ScoreCounter createState() => new _ScoreCounter();
}
class _ScoreCounter extends State<ScoreCounter> with SingleTickerProviderStateMixin{
AnimationController _controller;
@override
void initState() {
super.initState();
_controller = new AnimationController(
duration: const Duration(seconds: 10),
vsync: this,
)..forward();
}
@override
build(BuildContext context){
return new AnimatedBuilder(
animation: _controller,
child: new Container(width: 200.0, height: 200.0, color: Colors.green),
builder: (BuildContext context, Widget child) {
//What to return that scales the element
},
);
}
}
对于旋转,我会使用变换并返回一个矩阵。但是我应该返回什么来完成缩放动画?
提前致谢
【问题讨论】: