내 AnimatedList의 애니메이션에 커브 (예 : Curves.easeIn)를 어떻게 추가 할 수 있습니까?
AnimatedList(
key: _animList,
initialItemCount: _myList.length,
itemBuilder: (context, index, animation) {
return SlideTransition(
position: animation.drive(Tween(begin: Offset(1, 0), end: Offset(0, 0))), <-- curve?
child: Container(color: Colors.red, height: 100, width: 100)
);
}
)
Tween 에서 chain 메서드를 호출해야합니다 . 체인 방법은 소요 CurveTween를 상기 CurveTween는 얻어 곡선
이 시도
AnimatedList(
key: _animList,
initialItemCount: _myList.length,
itemBuilder: (context, index, animation) {
return SlideTransition(
position: animation.drive(
Tween(begin: Offset(1, 0), end: Offset(0, 0))
.chain(CurveTween(curve: Curves.bounceIn))),
child: Container(color: Colors.red, height: 100, width: 100));
});
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다