GithubHelp home page GithubHelp logo

Comments (3)

Milad-Akarie avatar Milad-Akarie commented on August 20, 2024

@natintosh not everything is supported for path navigation because a path can push one or multiple pages.
explain your use-case maybe I can suggest something?

from auto_route_library.

natintosh avatar natintosh commented on August 20, 2024

@natintosh not everything is supported for path navigation because a path can push one or multiple pages. explain your use-case maybe I can suggest something?

Okay so I'm working on a multi-module project with multiple teams working on a different module and each module has it own routes... then in the main app we are appending each module's routes during initialization.

class AppRouter extends RootStackRouter {
  final List<AppRouteInfo> routesInfo;

  AppRouter({this.routesInfo = const []}) : super();

  @override
  Map<String, PageFactory> get pagesMap =>
      routesInfo.fold(<String, PageFactory>{}, (previousValue, element) {
        return {...previousValue, ...element.pagesMap};
      });

  @override
  List<AutoRoute> get routes => routesInfo
      .fold(<AutoRoute>[], (prev, element) => [...prev, ...element.routes]);
}

Due to this, we are mostly using named routing to route between modules and there are some use cases whereby I would need to move on to another module and pop all stack until a page and push

for instance...

    context.router.popUntilRouteWithName(RequirementsRoute.name);
    context.router.push('/settings');
          context.router.popUntil((route) => false);
          context.router.replaceNamed('/dashboard');

from auto_route_library.

Milad-Akarie avatar Milad-Akarie commented on August 20, 2024

@natintosh not of that explains the need of using paths instead of route objects?

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.