How to `dismiss` several pages in one time in Flutter? - flutter

If you have ever developed iOS app, you will know the dismiss(animated:) makes the UINavigationController move out of the screen from below, and it takes its child controllers together. I don't know how to implement it in Flutter:
Page A jump to page B with transition down to up, page B jump to page C with default transition right to left. Now I don't know how to go back to page A with transition up to down.

Use navigator.pushAndRemoveUntil to navigate to A. This would remove B and C.
From the documentation, pushAndRemoveUntil is used to:
Push the given route onto the navigator, and then remove all the
previous routes until the predicate returns true.

Related

Flutter: How can I get normal navigator behavior on generated routes?

The problem is not being able to initialize a navigator with a navigation history.
I have a work around but cannot seem to match the normal pop and push animations. It is a subtle difference, but stands out when the rest of the navigation animations work the standard way and then this one screen is custom.
Desired: Popping a route moves off screen to the right 'staying on top' and the previous/parent screen slides in slightly from the left 'behind the popped one'.
I've got over 400 leaf nodes to pick from. Values come in the form: A/B/C it mimics a folder structure.
The issue is my value picking screen must be able to open up deep into the hierarchy and has no history to pop back to.
I've tried pushing the stack history before the target to get the history 'primed' but this results in unwanted navigation animation. The screen must open up on the chosen values folder/screen.
I've recreated the setup in dartpad here:
https://dartpad.dartlang.org/?id=0f3a3fd815c1754c964c4e7f5a872052
Thanks in advance.

Push navigator Flutter

if I have an app and open 2 pages with push navigator, is there any way to open the 3rd page in order to delete the second one (and the first page remain)?
I don't know if it went well to understand my doubt
I believe you want to navigate to the next screen without the way back.
You can refer to the question, Move to a new screen without providing navigate back to previous screen and use Navigator.pushReplacement

flutter: best way to implement inner navigation with bottom nav bar

I'm developing a flutter application and I'm now struggling to understand what is the best way to implement a complex bottom bar navigation.
Here are my requirements:
each button on the nav bar should lead to a different section
each section should be able to have multiple screens inside of it
user can navigate from any page of a section to any page in another section and back
each section should show the last visited page if we come back to it
for example, let's say we have two sections, each made of two pages: SectionOneA, SectionOneB, SectionTwoA, SectionTwoB.
A few use cases:
user navigates from SectionOneB to SectionTwoB by pressing a button inside SectionOneB, when user presses back (on android) from SectionTwoB, we should navigate back to SectionOneB
user navigates to SectionTwoA by the nav bar, then navigates to SectionTwoB via a button in SectionTwoA, then navigates to SectionOneA via the nav bar and then press the SectionTwo icon in the nav bar again. we should show SectionTwoB. if back is pressed we should navigate to SectionTwoA.
in both these examples, when moving from one section to another, the correct nav bar item should be highlighted.
I'm new to flutter so I'm learning as I go. For now, what I've done is using nav bar with PageViewer to switch from section to section, then each section uses a PageViewer to handle switching from page to page. This worked well until I had to implement the first usecase above, at this point it seems to me that it would be quite challenging to implment a proper navigation stack as demanded by the usecase and I feel it would be better to rethink the whole thing, only I've no idea what is the best way to approach this.
A temporary solution would be to also include SectionTwoB in the PageViewer of section one, but that would not allow me to highlight the proper nav bar item.
Any lead on how to approach this? All the examples I find seems too simple and/or I'm failing at understanding how to connect the pieces together. I'm using flutter_bloc as a state management library.

Flutter - Bottom bar with different number of screens

an app should be controlled via three navigation points in the foot.
The first point is just one side. The second point consists of a PageView.
In the third point, a list (navigation bar) should be scrolled through and offer many screens.
Is it technically easy to do? I successfully implemented the first and second point.
I still fail on the third point. I want to ask if there is a simple approach to this that I may be overlooking.
My code seems to be going messie: /
It should also be possible, for example, to insert a button in the first "single screen" that references a specific page of the "bottom app bar".
try this
Flutter curved navigation bar plugin you can create flutter custom bottom navigation bar in your project.
link 1
link 2

popAndReplacement shows page which is behind the poping page in Flutter

There are 3 screens in my app. When I use popAndPushNamed() in the 2nd page, it pops the 2nd page and shows the 3rd page, but when It pops it shows the 1st page behind it in milliseconds. how to avoid that?
is Animation the way?
or are there any other methods just like push and show 3rd page, and pop 2nd page when the 3rd page visible to the user?
popAndPushNamed() as the documentation suggests, pushes the new route but pops the old route simultaneously, and hence, there is a small moment where you can see the first page even if your new routes are fully opaque. Replace the method with Navigator.of(context).pushReplacementNamed() and it should work as expected.