GithubHelp home page GithubHelp logo

Comments (5)

Milad-Akarie avatar Milad-Akarie commented on June 16, 2024

Hey @agonzalezpuerta I just tested this and it seems to be working just fine, what navigation operation are you doing that don't trigger a rebuild?

from auto_route_library.

agonzalezpuerta avatar agonzalezpuerta commented on June 16, 2024

Dear @Milad-Akarie,
Thanks for the quick reply. Let me try to give you the full context. Any idea of what could be going wrong?

BTW, we reached you via Twitter. Will send you an email shortly.

The navigation is done using the push method on the nearest router, which in this example should be ProfileRouter. The method is triggered from a page in such router (ProfileLandingRoute)

context.router.push( const PersonalInfoRoute());

The nested routers are passed in the routes parameter of the AutoTabsScaffold:

return AutoTabsScaffold(
      appBarBuilder: (context, tabsRouter) => AppBar(
        leading: const AutoLeadingButton(
          ignorePagelessRoutes: true,
        ),
      routes: const [
        OneRouter(),
        AnotherRouter(),
        ProfileRouter(),
      ],

All this uses the following tree structure:

    AutoRoute(
      page: HomeRoute.page,
      children: [
        AutoRoute(
          page: OneRouter.page,
          children: [
            AutoRoute(
              page: FooRoute.page,
              initial: true,
            ),
          ],
        ),
        AutoRoute(
          page: AnotherRouter.page,
          children: [
            AutoRoute(
              page: FooFooRoute.page,
              initial: true,
            ),
          ],
        ),
        AutoRoute(
          page: ProfileRouter.page,
          maintainState: false,
          children: [
            AutoRoute(
              page: ProfileLandingRoute.page,
              initial: true,
            ),
            AutoRoute(
              page: PersonalInfoRoute.page,
            ),
          ],
        ),
      ],
    ),

    // ............

@RoutePage(name: 'OneRouter')
class OneRouterPage extends AutoRouter {
  const OneRouterPage({super.key});
}

@RoutePage(name: 'AnotherRouter')
class AnotherRouterPage extends AutoRouter {
  const AnotherRouterPage({super.key});
}

@RoutePage(name: 'ProfileRouter')
class ProfileRouterPage extends AutoRouter {
  const ProfileRouterPage({super.key});
}

from auto_route_library.

Milad-Akarie avatar Milad-Akarie commented on June 16, 2024

@agonzalezpuerta your setup looks seems fine to me, not sure what's happening, could you try using appBar property instead of appBarBuilder?

from auto_route_library.

agonzalezpuerta avatar agonzalezpuerta commented on June 16, 2024

Dear Milad,
Thanks for the reply and your time. We found it was a bug on our end while setting up the top-most routes. Our app has an "entry point" that is intended to replace all routes depending on login status. We were using context.router.replace instead of context.router.replaceAll.

By the way, as per your last answer, how do you access the appBar property in AutoTabsScaffold? We noticed it is not available. Not sure what you meant exactly.

Thanks again.

from auto_route_library.

Milad-Akarie avatar Milad-Akarie commented on June 16, 2024

@agonzalezpuerta My bad, I thought appBar was exposed, now I'm thinking it should be exposed!

from auto_route_library.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.