qlevar_router icon indicating copy to clipboard operation
qlevar_router copied to clipboard

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

Open tabletpad opened this issue 6 months ago • 1 comments

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? `

tabletpad avatar Feb 04 '24 02:02 tabletpad

@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');

SchabanBo avatar Feb 06 '24 14:02 SchabanBo