如何进行自定义过渡并保持ios向后滑动

时间:2020-05-12 09:38:35

标签: flutter

我创建了一个扩展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向后滑动

1 个答案:

答案 0 :(得分:1)

我在这里找到了解决方案,希望这对某人有帮助 https://juejin.im/post/5d3ea81af265da03f04ca5d9#heading-4