large Flutter Favorite logosmall Flutter Favorite logo

go_router 3.0.1 icon indicating copy to clipboard operation
go_router: ^3.0.1 copied to clipboard

A declarative router for Flutter based on Navigation 2 supporting deep linking, data-driven routes and more

Pub
Version Test codecov License

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 #

520
likes
130
pub points
96%
popularity

Publisher

shield icon for verified publisherssellsbrothers.com

A declarative router for Flutter based on Navigation 2 supporting deep linking, data-driven routes and more

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (LICENSE)

Dependencies

collection, flutter, flutter_web_plugins, logging, path_to_regexp

More

Packages that depend on go_router