I have implemented bottom sheet navigation similar to the one used in the AI Playlist Generator. I have a ShellRoute that returns a ModalSheetPage within the ShellRoute.pageBuilder method. The routes in the Shell are either DraggableNavigationSheetPage or ScrollableNavigationSheetPage.
The navigation works well, and I can have nicely animated transitions when opening Sheet-A and then pushing Sheet-B. Popping Sheet-B also transitions smoothly back. However, if I add a close button on Sheet-A to pop Sheet-A, both the transition animation and the ModalSheetPage animation play, resulting in a strange closing animation.
On the other hand, if I tap the barrier, only the animation of the ModalSheetPage plays, and Sheet-A remains visible.
Is there a way to ensure that the transition animation is not used when popping the last sheet in a ShellRoute so that only the "slide-down" animation of the modal sheet is used?
Here is an example of recoding. Due to the platform, it uses the "Slide" transition, which looks weird when closing the sheet:
As I am using GoRouter with Shell routes I realized there I can just use GoRouter.of rather than Navigator.of which just shows the modal close animation
I have implemented bottom sheet navigation similar to the one used in the AI Playlist Generator. I have a
ShellRoute
that returns aModalSheetPage
within theShellRoute.pageBuilder
method. The routes in the Shell are eitherDraggableNavigationSheetPage
orScrollableNavigationSheetPage
.The navigation works well, and I can have nicely animated transitions when opening
Sheet-A
and then pushingSheet-B
. PoppingSheet-B
also transitions smoothly back. However, if I add a close button onSheet-A
to popSheet-A
, both the transition animation and theModalSheetPage
animation play, resulting in a strange closing animation.On the other hand, if I tap the barrier, only the animation of the
ModalSheetPage
plays, andSheet-A
remains visible.Is there a way to ensure that the transition animation is not used when popping the last sheet in a
ShellRoute
so that only the "slide-down" animation of the modal sheet is used?Here is an example of recoding. Due to the platform, it uses the "Slide" transition, which looks weird when closing the sheet:
https://github.com/user-attachments/assets/068048fe-f16d-4000-b3f8-5dc81c29d36c