tree: 152281d1f0caa1e8fccff844801771e258325459 [path history] [tgz]
  1. example/
  2. lib/
  3. test/
  4. .metadata
  5. analysis_options.yaml
  6. AUTHORS
  7. CHANGELOG.md
  8. LICENSE
  9. pubspec.yaml
  10. README.md
packages/go_router/README.md

Welcome to go_router!

The purpose of the go_router package is to use declarative routes to reduce complexity, regardless of the platform you're targeting (mobile, web, desktop), handle deep and dynamic linking from Android, iOS and the web, along with a number of other navigation-related scenarios, while still (hopefully) providing an easy-to-use developer experience.

You can get started with go_router with code as simple as this:

class App extends StatelessWidget {
  App({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) => MaterialApp.router(
        routeInformationParser: _router.routeInformationParser,
        routerDelegate: _router.routerDelegate,
        title: 'GoRouter Example',
      );

  final _router = GoRouter(
    routes: [
      GoRoute(
        path: '/',
        builder: (context, state) => const Page1Screen(),
      ),
      GoRoute(
        path: '/page2',
        builder: (context, state) => const Page2Screen(),
      ),
    ],
  );
}

class Page1Screen extends StatelessWidget {...}

class Page2Screen extends StatelessWidget {...}

But go_router can do oh so much more!

See gorouter.dev for go_router docs & samples