在我的应用程序中实现的这段代码中,我想更改SizeTransition
动画的开始位置,但是我无法找到有关此内容的任何文件
SizeTransition(
sizeFactor: CurvedAnimation(parent: _animationController,curve: Curves.easeInOut),
axisAlignment: 0.0,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
],
),
),
因为SizeTransition
将从zero
开始,而我想将其更改为0.5
,对此问题有任何机构意见吗?
答案 0 :(得分:1)
要更改开始位置,您需要更改偏移量:
SlideTransition(
position: Tween<Offset>(
begin: const Offset(-1, 0),
end: Offset.zero,
).animate(animation),
child: child,
)
// from left
position: Tween<Offset>(
begin: const Offset(-1, 0),
end: Offset.zero,
).animate(animation),
// from right
position: Tween<Offset>(
begin: const Offset(1, 0),
end: Offset.zero,
).animate(animation),
// from bottom
position: Tween<Offset>(
begin: const Offset(0, 1),
end: Offset.zero,
).animate(animation),
// from top
position: Tween<Offset>(
begin: const Offset(0, -1),
end: Offset.zero,
).animate(animation),