Closed vladimir-boyko closed 2 months ago
not sure what's going on but I got two pointers for you, First, the navigator will skip animation for the very first route, Second, you're using a custom route with no transitions builder, by default CustomRoute has no transition
@Milad-Akarie 1) It is not the very first route, it is the first route in declarative builder. 2) I applied transitions to child routes, it is where question lies, I want different transitions for different routes
the first child of a sub-router will not be animated as well
@Milad-Akarie Is it the intented behaviour, or is it a bug? And one more thing, if I add transition builder to AutoRouter.declarative, then transition will happen with the first child route, it is strange for me.
it's actually intended, this by the done by stock Navigator, meaning it's not an auto_route thing, it will not look nice to animate the first route as the background will be blank.
@Milad-Akarie Alright, is there a way to override this behaviour? At least how it can possibly be overrided
@vladimir-boyko I'm really not sure, maybe take a dive into NavigatorState see what they're doing there.
I'm closing this for now, feel free to reopen if you there is any thing I can help you with.
I stumbled to this problem recently while developing feature-flow with multiple pages.
I want to navigate to AutoRouter.declarative and set initial route conditionally. Sometimes first route will be bottom sheet page, sometimes regular full-screen page. Also I want AutoRouter page to be transparent (
opaque: false
) to be able to see previous page behind bottom sheet.Problem: If I set any animations to the first declarative route in app_router.dart, it is ignored and shows default animation.
Also there is a problem when I'm dismissing my bottom sheet route and transparent auto router is still presents on the screen. Then I need to use gestures to close it
I want to understand what I'm doing wrong and be able to handle it.
Link to complete example - https://github.com/vladimir-boyko/test-auto-route
Here's my declarative router:
App Router
Top Screen
Regular Screen
Bottom Sheet Screen
CustomModalBottomSheetRoute