-
Notifications
You must be signed in to change notification settings - Fork 26.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Makes a convenient page class for PageRouteBuilder #80804
Comments
Regarding page transition, I have also problem when I swap pages. Currently, navigator only support transition when adding new page or removing a page. But if we have It would be nice, if swapping pages also being animated. Default should be cross fade, but of course configurable. Use case for swapping pages is to use a single Navigator or Router with [PageA, PageB] as body for TabA and TabB in a When we click TabB, we just need to swap the Navigator pages to |
@nguyenxndaidev you can do that by giving it a different key, but they will be treated as new pages and lose all its state. If you want to reorder the page with the state and expecting page transition, that is a use case we didn't support. In our current design, page transition is only triggered when a new page is added or an existing page is removed. |
If I don't need to keep state, I don't need to use different key. I just need to change from [PageA] to [PageB] when click TabB.
I think if flutter can support the transition when existing page is moved from/to top page, it will solve a lot of problems. |
Not only the problems mentioned above, assuming we combine complex nested navigators with IndexedStack and AnimatedSwitcher (or similar Transition widget), BottomNavigationBar and TabBar. In this case, multiple animations will happens at the same time and out of control when we navigate to a new page, which requires to changes pages in nested navigators together with the change of another bottom tab and also another tab bar. @chunhtai what's your opinion if we want to have all 3 things?
IMHO, we really need to have a custom page, which allows to control animation when an existing page moving from/to top page and remove the need of AnimatedSwitcher (or similar Transition widget). |
I have a similar use case, given the current API it is really easy to code yourself into this corner as it seems reasonable to keep state by rearranging the pages stack, losing animation makes it a dead end that isn't obvious. It's a shame because it takes a lot of work to get around. I would suggest adding a note to the documentation that moving pages doesn't trigger an animation on the top page to save others some headache. |
This sounds like a broader subject, currently the page transition is tied to the route life cycle, for example, the exiting transition always end with route being disposed. It will be a big refactor. Can you open a new issue to discuss this (i.e, apply page transition when reordering the pages)? |
This issue is marked P1 but has had no recent status updates. The P1 label indicates high-priority issues that are at the top of the work list. This is the highest priority level a bug can have if it isn't affecting a top-tier customer or breaking the build. Bugs marked P1 are generally actively being worked on unless the assignee is dealing with a P0 bug (or another P1 bug). Issues at this level should be resolved in a matter of months and should have monthly updates on GitHub. Please consider where this bug really falls in our current priorities, and label it or assign it accordingly. This allows people to have a clearer picture of what work is actually planned. Thanks! |
We had MaterialPage class for MaterialPageRoute, and CupertinoPage class for CupertinoPageRoute, we should come up with a convenient page class for PageRouteBuilder. We don't have this before because we can't figure out how to handle the scope issue when using page class. The page class can't take in widget builder, otherwise it is very easy to break the widget tree during the page transition.
The text was updated successfully, but these errors were encountered: