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

Some Pages Become Static and Will Never Refresh or Update With New Data #146

Closed tabletpad closed 2 months ago

tabletpad commented 7 months ago
class AppRoutes {
  List<QRoute> routes = [
    QRoute(
        pageType: const QFadePage(
            transitionDuration: Duration(milliseconds: 100),
            reverseTransitionDuration: Duration(milliseconds: 100)),
        path: routesPath[0],
        builder: () => HomePageListview(title: pages[0])),
    // middleware: [DeferredLoader(page1.loadLibrary)]),

    QRoute(
        pageType: const QFadePage(
            transitionDuration: Duration(milliseconds: 100),
            reverseTransitionDuration: Duration(milliseconds: 100)),
        path: routesPath[5],
        builder: () => page6.DatabaseManagement(title: pages[5]),
        middleware: [DeferredLoader(page6.loadLibrary)]),

    QRoute(
        pageType: const QFadePage(
            transitionDuration: Duration(milliseconds: 100),
            reverseTransitionDuration: Duration(milliseconds: 100)),
        path: routesPath[9],
        builder: () => page10.LoginPage(title: pages[9]),
        middleware: [DeferredLoader(page10.loadLibrary)]),
  ];
}

the "/" root page, which is the first entry, became cache and static after using qlever_route. When clicking on the menu to go home page, it never enter into the homepage widget at all until manually refresh the browser.

what could be the caused? `

SchabanBo commented 7 months ago

@tabletpad How do you navigate to the HomePage. If the homePage was already in the stack, the router will not rebuild it agian. To force the rebuild use

QR.to('Page Path', pageAlreadyExistAction: PageAlreadyExistAction.Remove);
// or
QR.navigator.replaceAll('Page path');