Skip to content
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

[Example] Add bottom_navigation_complex #535

Open
wants to merge 17 commits into
base: master
Choose a base branch
from

Conversation

NeroThroN
Copy link

@NeroThroN NeroThroN commented Jun 29, 2022

⚠️ This example still contains lots of bugs ⚠️

Description

Add a complete and complex example using multiples Beamers with deep and root pages.

Issue tracker:

  • Bottom Navigation Bar: Only after the second click on an item the routeListener is trigger
  • Route conflict : When going from a BeamPage (A) to a sibling (B), if we push again the first (A), the second (B) is removed from history. Like a popUntil and not a push.
  • Back button : After opening /Books/1, /Books/2, /Books/3 (screens inside Layout), when using android back button the history is updated but not the application's screen.
  • AppBar leading pop page: When navigating to the route /Book/:bookID, when using the default back button inside the AppBar, the route is updating to /Book. The correct behavior for this can be trigger by the back button on the web browser . In this example the /Book page doesn't exist, only the /Book/:bookID one (Maybe a redirect to the initial path when navigating to /Book ?)
  • Route not found: When navigating to /Book/:bookID, unable to open /Books/:bookID (the nested in layout one) via push or pop (if the page was open before)
  • Deeplink: Going from /Books to /Articles/1 lead to NotFound page.

Bonus:

  • Exit app only on the initial route: Exit the app only on the /Books route. If we are in the /Articles, when poping this route should navigate in /Books where the app can now be poped.

Pages structure

bottom_navigation_complex

@slovnicki slovnicki self-assigned this Jul 6, 2022
@slovnicki
Copy link
Owner

Hey @NeroThroN 👋
Sorry for the delay, but I finally had the time to take a look at this.

Very cool! 💙

As we talked on Discord, this is a great addition to the examples and I really like it.
Tomorrow evening I'll try to advise you on some easier issues you provided (although all of them are tough and very specific 🙂)

I hope we merge this by the end of the week 💪

Thanks again and sorry for late response 😞

@IlyaMax
Copy link

IlyaMax commented Jul 21, 2022

@NeroThroN Hello, your example is very good, but there are some cases which I think should be included also. Pls read this issue #542 . I don't find in this example how can I reach deep link destination. For instance this "/Articles/1".

@dleurs
Copy link

dleurs commented Jul 21, 2022

@NeroThroN Thank you very much for this example ! It was exactly what I was looking for. It seems flutter's favorite go_router cannot provide such functionnalities with bottom nav bar. Hope bugs will be solved

@rivella50
Copy link

@dleurs And go_router still is not capable of providing multiple navigation stacks.

@dleurs
Copy link

dleurs commented Jul 22, 2022

On real device Android 10 Honor 10 --profile --trace-skia , I am having heavy performance issues, with a lot of janks

image

@slovnicki
Copy link
Owner

Hey guys!

As I spoke with @NeroThroN, I'm working on a new feature called "Route Structure" which should help in building complex scenarios like this one. Current draft PR is here, but needs more work until I merge it.

I'm also on a vacation so things are massively slowed down these weeks.

@slovnicki
Copy link
Owner

Hey @NeroThroN 👋
Long time no see. I'm getting healthier and having a bit more time so I checked this again.

Deeplink: Going from /Books to /Articles/1 lead to NotFound page.

The correct action is already implemented for onLongPress (it should also be the action for onTap):

onLongPress: () => Beamer.of(context).root.beamToNamed('/Article/${article.id}'),
// or onLongPress: () => Beamer.of(context, root: true).beamToNamed('/Article/${article.id}'),

We have to take the root Beamer here because we're inside booksRouterDelegate so context.beamToNamed will try to use that router, which has no knowledge of articles.

Route conflict : When going from a BeamPage (A) to a sibling (B), if we push again the first (A), the second (B) is removed from history. Like a popUntil and not a push.

Can you describe this one in terms of exact routes in the app? I have a vague idea of what you're talking about, but am unsure how to reproduce this exactly in the app.

Exit app only on the initial route: Exit the app only on the /Books route. If we are in the /Articles, when poping this route should navigate in /Books where the app can now be poped.

A general note regarding this (presuming it's about the Android back button); Overall behavior should be better if BeamerBackButtonDispatcher is put only on MaterialApp.router and removed from nested Beamers. I believe that the default behavior should be /Articles -> /Books -> exit if we didn't deep link to /Articles, but this could also also be tweaked further.

@pishguy
Copy link

pishguy commented Jul 23, 2023

@NeroThroN

Is this example relevant to the problem that I have encountered? Please check the link below.

#631

@stan-at-work
Copy link
Contributor

Are there updates on this ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants