Milad-Akarie / auto_route_library

Flutter route generator
MIT License
1.52k stars 384 forks source link

Unable to Set Custom Transition Duration While Maintaining iOS Swipe Back Gesture #1971

Closed snackva closed 2 days ago

snackva commented 1 month ago

I am using AutoRoute in my Flutter project and encountering an issue when trying to set a custom transition duration for routes. I would like to maintain the default iOS swipe back gesture while having a custom transition duration.

Problem:

When I use CustomRoute to set the transition duration, the swipe back gesture on iOS is lost:

CustomRoute(
  page: ProfileRoute.page,
  path: "/profile/:userId",
  guards: [AuthGuard()],
  durationInMilliseconds: 500,
  transitionsBuilder: TransitionsBuilders.slideLeft
)

On the other hand, using AutoRoute maintains the swipe back gesture but does not allow me to set a custom transition duration:

AutoRoute(
  page: ProfileRoute.page,
  path: "/profile/:userId",
  guards: [AuthGuard()]
)

Request:

Is there a way to achieve both a custom transition duration and maintain the iOS swipe back gesture? Any guidance or suggestions on how to resolve this issue would be greatly appreciated.

Additional Information:

Thank you for your help!

Milad-Akarie commented 1 month ago

Hey @snackva unfortunately this is not a bug, this is an intended behaviour, it doesn't make sense to swipe-back on a page that transitions from bottom up or from top down for example.

snackva commented 1 month ago

Thanks @Milad-Akarie but the desired behavior is to have the same transition animation and swipe back gesture in iOS while changing the transition duration. Isn't there a way to archieve that?

snackva commented 3 weeks ago

Any update? @Milad-Akarie

Milad-Akarie commented 2 days ago

@snackva not going to be able to help with this as I have no plans on customising a platform's default transition maybe try to extend the cupertino page route your self and use it as a custom route.