【发布时间】:2019-06-19 10:47:32
【问题描述】:
我正在使用 Animator 包来移动容器。我想要实现的是将容器从Alignment.bottomCenter移动到Alignment.topCenter,但我只能使用偏移量。有没有办法使用对齐?
Animator(
triggerOnInit: _logoMovesUp,
tween: Tween<Offset>(
//HERE I WANT TO USE THE ALIGNMENT
begin: Offset(0.0, 0.0), end: Offset(0.0, -100.0)),
duration: Duration(seconds: 1),
builder: (anim) => Transform.translate(
offset: anim.value,
child: Container(
alignment: Alignment.bottomCenter,
child: Container(Text('Test')),
))
【问题讨论】:
标签: animation flutter translate animator