gpt4 book ai didi

Flutter/Dart - 滑动动画的反向?

转载 作者:行者123 更新时间:2023-12-03 04:38:18 24 4
gpt4 key购买 nike

我从 Flutter.dev 网站获得了以下示例。它提供了流畅的onSwipeUp动画片。但是如何修改代码给我一个流畅的onSwipeDown动画片?我尝试反转 var beginvar end但它似乎没有奏效,当我刷卡时什么也没发生。这是刷卡代码;

onSwipeDown: (){
Navigator.of(context).push(_opidRoute(routeaudioid: opid));
},
这是动画;
    Route _opidRoute({String routeaudioid, String mastertitle}) {
return PageRouteBuilder(
opaque: false,
pageBuilder: (context, animation, secondaryAnimation) => SingleOpid(opid: routeaudioid
),
transitionsBuilder: (context, animation, secondaryAnimation, child) {
var begin = Offset(0.0, 1.0);
var end = Offset.zero;
var curve = Curves.ease;

var tween = Tween(begin: begin, end: end).chain(CurveTween(curve: curve));

return SlideTransition(
position: animation.drive(tween),
child: child,
);
},
);
}
有什么想法可以扭转方向吗?

最佳答案

尝试

var begin = Offset(0.0, -1.0);

关于Flutter/Dart - 滑动动画的反向?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63711408/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com