slovnicki / beamer

A routing package built on top of Router and Navigator's pages API, supporting arbitrary nested navigation, guards and more.
MIT License
591 stars 129 forks source link

Facilitate debugging navigation issues with more elaborative `BeamPage.notFoundDebug` #597

Open annawidera opened 1 year ago

annawidera commented 1 year ago

Is your feature request related to a problem? Please describe. I am trying to resolve the navigation issue, which takes me to the NotFound page. I'd find it helpful if I could easily see some debug details on this page (like path, parameters, etc.)

Describe the solution you'd like I'd love to have BeamPage.notFoundDebug page besides already existing and very minimal BeamPage.notFound.

Describe alternatives you've considered I was looking for Beamer objects in the Widget tree in VS Code. Unfortunately in the state when I already see Not found page, there is no Beamer-related object in the tree. So I don't know how to sneak in the internal state of any BeamerDelegate to see what was wrong with my navigation.

slovnicki commented 1 year ago

Hey @annawidera :wave: Thanks for creating an issue and again - sorry for my absence lately.

This sounds like a good idea. Although we can specify arbitrary page at

BeamerDelegate(
  ...
  notFoundPage: ... 
)

we don't really have much to work with to retrieve information. Sure, it is possible, but not convenient.

I suggest that we add a new property to BeamerDelegate which would be a function

final BeamPage Function(BuildContext context, RouteInformation configuration) notFoundPageBuilder;

that could be specified in BeamerDelegate constructor. We can also put a default that would print configuration on the screen.

Does this sound good to you?

Would you like to work on this feature? I'm ready to help with whatever you need.