我创建了一个扩展MaterialPageRoute的customRoute,并重写了buildTransitions以在不同情况下进行不同的转换
class MyCustomRoute<T> extends MaterialPageRoute<T> {
final Widget Function(
BuildContext, Animation<double>, Animation<double>, Widget)
transitionsBuilder;
MyCustomRoute(
{WidgetBuilder builder, RouteSettings settings, this.transitionsBuilder})
: super(builder: builder, settings: settings);
@override
Widget buildTransitions(BuildContext context, Animation<double> animation,
Animation<double> secondaryAnimation, Widget child) {
return transitionsBuilder(context, animation, secondaryAnimation, child);
}
}
它工作正常,但是ios中的向后滑动功能消失了,我想知道如何进行自定义过渡并保持ios向后滑动