mickey
mickey

Reputation: 77

How to make custom transition and keep the ios swipe back

I made a customRoute that extends MaterialPageRoute, and I override the buildTransitions to do different transition in different situation

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);
  }
}

it works fine but the swipe back feature in ios is gone, I want to know how to make custom transition and keep the ios swipe back

Upvotes: 2

Views: 784

Answers (1)

mickey
mickey

Reputation: 77

I found a solution at here, hope this will help someone https://juejin.im/post/5d3ea81af265da03f04ca5d9#heading-4

Upvotes: 1

Related Questions