SchabanBo / qlevar_router

Manage you project Routes. Create nested routes. Simply navigation without context to your pages. Change only one sub widget in your page when navigating to new route.
MIT License
86 stars 22 forks source link

Switch from pages save state #138

Closed Gino1963 closed 1 year ago

Gino1963 commented 1 year ago

Hi,

I do not understand anything anymore. I use dynamic routes because they allow me to open multiple pages of the same widget. Qlevar is perfect, you can add and remove routes. It works very well.

My english is bad and maybe the pictures are clearer.

My home page Immagine_1

When I press the "Products" button on the left, I create the new route and open the page. addRoutes([QRoute(path: "/products", builder: () => Products() )]); Now I have a new button on my AppBar

Immagine_2

addRoutes([QRoute(path: "/products1", builder: () => Products() )]); Two buttons with same label but different path Immagine_3

By clicking on the Appbar button I want to skip from Products Button (Page 3) to Products Button (Page 2) and to do this I use the code: QR.to("/products", pageAlreadyExistAction: PageAlreadyExistAction.IgnoreChildrenAndBringToTop);

all works fine !!!!!!!!!

From Page 2 I open /productDetail Immagine_4

If I switch from /productDetail to /products1 all works fine, the state is perfect. I go back to /productDetail and all works fine !!!! Fantastic !!!!

Now from page 3 I open /productDetail1

Immagine_5

If I switch from /productDetail1 to /productDetail ....... the path of browser change but not the content of page.

Using Show Active Tree all is correct, I have four routes + Dashboard.

grrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr

Help me pleaseeeeeee !!!!!!!

Biagio

Gino1963 commented 1 year ago

Sorry, the problem is not Qlevar but using the same provider for two pages. I'm using riverpod, now I need to configure the provider to have separate state.

Long live Qlevar!!!!!