Viewing version 18.1.0. Open the latest package page.

go_router

18.1.0

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

Download archive

Readme

go_router

A declarative routing package for Flutter that uses the Router API to provide a convenient, url-based API for navigating between different screens. You can define URL patterns, navigate using a URL, handle deep links, and a number of other navigation-related scenarios.

Features

GoRouter has a number of features to make navigation straightforward:

  • Parsing path and query parameters using a template syntax (for example, "user/:id')
  • Displaying multiple screens for a destination (sub-routes)
  • Redirection support - you can re-route the user to a different URL based on application state, for example to a sign-in when the user is not authenticated
  • Support for multiple Navigators via ShellRoute - you can display an inner Navigator that displays its own pages based on the matched route. For example, to display a BottomNavigationBar that stays visible at the bottom of the screen
  • Support for both Material and Cupertino apps
  • Backwards-compatibility with Navigator API

Documentation

See the API documentation for details on the following topics:

Migration Guides

Changelog

See the Changelog for a list of new features and breaking changes.

Triage

See the GitHub issues for all Go Router issues.

The project follows the same priority system as flutter framework. P0 P1 P2 P3

Package PRs

Roadmap

This package is considered feature-complete. The Flutter team's primary focus will be on addressing bug fixes and ensuring stability. While active feature development is not currently planned, we still welcome and encourage community contributions to expand the package's functionality.

Changelog

18.1.0

  • Adds clipBehavior to ShellRoute and StatefulShellBranch, forwarded to the nested Navigator.

18.0.2

  • Fixes ShellRoute/StatefulShellRoute shell chrome (e.g. a side rail or app bar painted before the routed child) being dropped from the semantics tree by the active route's ModalBarrier. Fixes pushed routes nested within a shell being lost when a dynamic routing configuration changes.

18.0.1

Clarifies onEnter documentation regarding evaluation order relative to redirect: chains.

18.0.0

  • Migrates to material_ui and cupertino_ui.
  • Updates minimum supported SDK version to Flutter 3.44/Dart 3.12.

17.5.0

  • Adds route metadata support, including inheritance and override behavior with exposure on GoRouterState.
  • Documents support for regular expression constraints in GoRoute path parameters.

17.4.0

  • Fixes onExit ignored for GoRoute nested inside ShellRoute
  • Adds BlockedInitialNavigationException (a GoException subtype), raised when the initial navigation is blocked by onEnter with no prior route to restore, so apps can distinguish this case in onException without string matching.

17.3.0

  • Updates minimum supported SDK version to Flutter 3.38/Dart 3.10.
  • Adds hasOverriddenOnExit parameter to GoRouteData.$route and RelativeGoRouteData.$route helper methods for type-safe routes. When set to true, enables custom onExit callback invocation from route data classes extending GoRouteData or RelativeGoRouteData when the route is removed from the navigation stack.

17.2.3

  • Fixes an assertion failure when navigating to URLs with hash fragments missing a leading slash.

17.2.2

  • Fixes pop() restoring stale configuration when route has onExit, which could cause the popped route to reappear with async redirects.

17.2.1

  • Fixes chained top-level redirects not being fully resolved (e.g. / → /a → /b stopping at /a).
  • Fixes route-level redirects not triggering top-level redirect re-evaluation on the new location.

17.2.0

  • Fixes Block.then() and Allow.then() navigation callbacks being silently lost when triggered by refreshListenable due to re-entrant route processing.
  • Adds encoder, decoder and compare parameters to TypedQueryParameter annotation for custom encoding, decoding and comparison of query parameters in TypedGoRoute constructors.

17.1.0

  • Adds TypedQueryParameter annotation to override parameter names in TypedGoRoute constructors.

17.0.1

  • Fixes an issue where onEnter blocking causes navigation stack loss (stale state restoration).
  • Updates minimum supported SDK version to Flutter 3.32/Dart 3.8.

17.0.0

  • BREAKING CHANGE
    • ShellRoute's navigating changes notify GoRouter's observers by default.
    • Adds notifyRootObserver to ShellRouteBase, ShellRoute, StatefulShellRoute, ShellRouteData.$route, TypedShellRoute, TypedStatefulShellRoute.

16.3.0

  • Adds a top-level onEnter callback with access to current and next route states.

16.2.5

  • Fixes GoRouter.of(context) access inside redirect callbacks by providing router access through Zone-based context tracking.
  • Adds support for using context extension methods (e.g., context.namedLocation(), context.go()) within redirect callbacks.

16.2.4

  • Fix Android Cold Start deep link with empty path losing scheme and authority.

16.2.3

  • Fixes an issue where iOS back gesture pops entire ShellRoute instead of the active sub-route.

16.2.2

  • Fixes broken links in readme.

16.2.1

  • Adds state restoration topic to documentation.

16.2.0

  • Adds RelativeGoRouteData and TypedRelativeGoRoute.
  • Updates minimum supported SDK version to Flutter 3.29/Dart 3.7.

16.1.0

  • Adds annotation for go_router_builder that enable custom string encoder/decoder #110781. Requires go_router_builder >= 3.1.0.

16.0.0

  • BREAKING CHANGE
    • Bump major version for GoRouteData breaking changes.
    • (Previously 15.2.4) Fixes routing to treat URLs with different cases (e.g., /Home vs /home) as distinct routes.
    • (Previously 15.2.3) Updates Type-safe routes topic documentation to use the mixin from go_router_builder 3.0.0.
    • (Previously 15.2.2) Fixes calling PopScope.onPopInvokedWithResult in branch routes.
    • (Previously 15.2.1) Fixes Popping state and re-rendering scaffold at the same time doesn't update the URL on web.
    • (Previously 15.2.0) GoRouteData now defines .location, .go(context), .push(context), .pushReplacement(context), and replace(context) to be used for Type-safe routing. Requires go_router_builder >= 3.0.0.

15.1.3

  • Updates minimum supported SDK version to Flutter 3.27/Dart 3.6.
  • Fixes typo in API docs.

15.1.2

  • Fixes focus request propagation from GoRouter to Navigator by properly handling the requestFocus parameter.

15.1.1

  • Adds missing caseSensitive to GoRouteData.$route.

15.1.0

  • Adds caseSensitive to TypedGoRoute.

15.0.0

  • BREAKING CHANGE
    • URLs are now case sensitive.
    • Adds caseSensitive parameter to GoRouter (default to true).
    • See Migrating to 15.0.0

14.8.1

  • Secured canPop method for the lack of matches in routerDelegate's configuration.

14.8.0

  • Adds preload parameter to StatefulShellBranchData.$branch.

14.7.2

  • Add missing await keyword to onTap callback in navigation.md.

14.7.1

  • Fixes return type of current state getter on GoRouter and GoRouterDelegate to be non-nullable.

14.7.0

  • Adds fragment support to GoRouter, enabling direct specification and automatic handling of fragments in routes.

14.6.4

  • Rephrases readme.

14.6.3

  • Updates minimum supported SDK version to Flutter 3.22/Dart 3.4.
  • Updates readme.

14.6.2

  • Replaces deprecated collection method usage.

14.6.1

  • Fixed PopScope, and WillPopScop was not handled properly in the Root routes.

14.6.0

  • Allows going to a path relatively by prefixing ./

14.5.0

  • Adds preload support to StatefulShellRoute, configurable via preload parameter on StatefulShellBranch.

14.4.1

  • Adds missing_code_block_language_in_doc_comment lint.

14.4.0

  • Adds current state getter on GoRouter that returns the current GoRouterState.

14.3.0

  • Adds missing implementation for the routerNeglect parameter in GoRouter.

14.2.9

  • Relaxes route path requirements. Both root and child routes can now start with or without '/'.

14.2.8

  • Updated custom_stateful_shell_route example to better support swiping in TabView as well as demonstration of the use of PageView.

14.2.7

  • Fixes issue so that the parseRouteInformationWithContext can handle non-http Uris.

14.2.6

  • Fixes replace and pushReplacement uri when only one route match in current route match list.

14.2.5

  • Fixes an issue where android back button pops pages in the wrong order.

14.2.4

  • Updates minimum supported SDK version to Flutter 3.19/Dart 3.3.
  • Fix GoRouter configuration in upgrading.md

14.2.3

  • Fixes redirect example's signature in route.dart.

14.2.2

  • Adds section for "Stateful nested navigation" to configuration.md.

14.2.1

  • Makes GoRouterState lookup more robust.

14.2.0

  • Added proper redirect handling for ShellRoute.$route and StatefulShellRoute.$route for proper redirection handling in case of code generation.

14.1.4

  • Fixes a URL in navigation.md.

14.1.3

  • Improves the logging of routes when debugLogDiagnostics is enabled or `debugKnownRoutes() is called. Explains the position of shell routes in the route tree. Prints the widget name of the routes it is building.

14.1.2

  • Fixes issue that path parameters are not set when using the goBranch.

14.1.1

  • Fixes correctness of the state provided in the onExit.

14.1.0

  • Adds route redirect to ShellRoutes

14.0.2

  • Fixes unwanted logs when hierarchicalLoggingEnabled was set to true.

14.0.1

  • Updates the redirection documentation for clarity

14.0.0

  • BREAKING CHANGE
    • GoRouteData's onExit now takes 2 parameters BuildContext context, GoRouterState state.

13.2.4

  • Updates examples to use uri.path instead of uri.toString() for accessing the current location.

13.2.3

  • Fixes an issue where deep links without path caused an exception

13.2.2

  • Fixes restoreRouteInformation issue when GoRouter.optionURLReflectsImperativeAPIs is true and the last match is ShellRouteMatch

13.2.1

  • Updates minimum supported SDK version to Flutter 3.16/Dart 3.2.
  • Fixes memory leaks.

13.2.0

  • Exposes full Uri on GoRouterState in GoRouterRedirect

13.1.0

  • Adds topRoute to GoRouterState
  • Adds lastOrNull to RouteMatchList

13.0.1

  • Fixes new lint warnings.

13.0.0

  • Refactors RouteMatchList and imperative APIs.
  • BREAKING CHANGE:
    • RouteMatchList structure changed.
    • Matching logic updated.

12.1.3

  • Fixes a typo in navigation.md.

12.1.2

  • Fixes an incorrect use of extends for Dart 3 compatibility.
  • Updates minimum supported SDK version to Flutter 3.10/Dart 3.0.

12.1.1

  • Retains query parameters during refresh and first redirect.

12.1.0

  • Adds an ability to add a custom codec for serializing/deserializing extra.

12.0.3

  • Fixes crashes when dynamically updates routing tables with named routes.

12.0.2

  • Fixes the problem that pathParameters is null in redirect when the Router is recreated.

12.0.1

  • Fixes deep-link with no path on cold start.

12.0.0

  • Adds ability to dynamically update routing table.
  • BREAKING CHANGE:
    • The function signature of constructor of RouteConfiguration is updated.
    • Adds a required matchedPath named parameter to RouteMatch.match.

11.1.4

  • Fixes missing parameters in the type-safe routes topic documentation.

11.1.3

  • Fixes missing state.extra in onException().

11.1.2

  • Fixes a bug where the known routes and initial route were logged even when debugLogDiagnostics was set to false.

11.1.1

  • Fixes a missing {@end-tool} doc directive tag for GoRoute.name.

11.1.0

  • Adds optional parameter overridePlatformDefaultLocation to override initial route set by platform.

11.0.1

  • Fixes the Android back button ignores top level route's onExit.

11.0.0

  • Fixes the GoRouter.goBranch so that it doesn't reset extra to null if extra is not serializable.
  • BREAKING CHANGE:
    • Updates the function signature of GoRouteInformationProvider.restore.
    • Adds NavigationType.restore to NavigationType enum.

10.2.0

  • Adds onExit to GoRoute.

10.1.4

  • Fixes RouteInformationParser that does not restore full RouteMatchList if the optionURLReflectsImperativeAPIs is set.

10.1.3

  • Fixes an issue in the documentation that was using state.queryParameters instead of state.uri.queryParameters.

10.1.2

  • Adds pub topics to package metadata.

10.1.1

  • Fixes mapping from Page to RouteMatchs.
  • Updates minimum supported SDK version to Flutter 3.7/Dart 2.19.

10.1.0

  • Supports setting requestFocus.

10.0.0

  • BREAKING CHANGE:
    • Replaces location, queryParameters, and queryParametersAll in GoRouterState with Uri.
    • See Migrating to 10.0.0 or run dart fix --apply to fix the breakages.

9.1.1

  • Fixes a link in error handling documentation.

9.1.0

  • Adds the parentNavigatorKey parameter to ShellRouteData and StatefulShellRouteData.
  • Fixes a typo in docs for StatefulShellRoute.indexedStack(...).
  • Cleans some typos in the documentation and asserts.

9.0.3

  • Adds helpers for go_router_builder for StatefulShellRoute support

9.0.2

  • Exposes package-level privates.

9.0.1

  • Allows redirect only GoRoute to be part of RouteMatchList.

9.0.0

  • BREAKING CHANGE:
    • Removes GoRouter.location. Use GoRouterState.of().location instead.
    • GoRouter does not extends ChangeNotifier.
    • Migration guide
  • Reduces excessive rebuilds due to inherited look up.

8.2.0

  • Adds onException to GoRouter constructor.

8.1.0

  • Adds parent navigator key to ShellRoute and StatefulShellRoute.

8.0.5

  • Fixes a bug that GoRouterState in top level redirect doesn't contain complete data.

8.0.4

  • Updates documentations around GoRouter.of, GoRouter.maybeOf, and BuildContext extension.

8.0.3

  • Makes namedLocation and route name related APIs case sensitive.

8.0.2

  • Fixes a bug in debugLogDiagnostics to support StatefulShellRoute.

8.0.1

  • Fixes a link for an example in path documentation. documentation.

8.0.0

  • BREAKING CHANGE:
    • Imperatively pushed GoRoute no longer change URL.
    • Browser backward and forward button respects imperative route operations.
  • Refactors the route parsing pipeline.

7.1.1

  • Removes obsolete null checks on non-nullable values.

7.1.0

  • Introduces StatefulShellRoute to support using separate navigators for child routes as well as preserving state in each navigation tree (flutter/flutter#99124).
  • Updates documentation for pageBuilder and builder fields of ShellRoute, to more correctly describe the meaning of the child argument in the builder functions.
  • Adds support for restorationId to ShellRoute (and StatefulShellRoute).

7.0.2

  • Fixes BuildContext extension method replaceNamed to correctly pass pathParameters and queryParameters.

7.0.1

7.0.0

  • BREAKING CHANGE:
    • For the below changes, run dart fix --apply to automatically migrate your code.
      • GoRouteState.subloc has been renamed to GoRouteState.matchedLocation.
      • GoRouteState.params has been renamed to GoRouteState.pathParameters.
      • GoRouteState.fullpath has been renamed to GoRouteState.fullPath.
      • GoRouteState.queryParams has been renamed to GoRouteState.queryParameters.
      • params and queryParams in GoRouteState.namedLocation have been renamed to pathParameters and queryParameters.
      • params and queryParams in GoRouter's namedLocation, pushNamed, pushReplacementNamed replaceNamed have been renamed to pathParameters and queryParameters.
    • For the below changes, please follow the migration guide.
      • params and queryParams in BuildContext's namedLocation, pushNamed, pushReplacementNamed replaceNamed have been renamed to pathParameters and queryParameters.
  • Cleans up API and makes RouteMatchList immutable.

6.5.9

  • Removes navigator keys from GoRouteData and ShellRouteData.

6.5.8

  • Adds name parameter to TypedGoRoute

6.5.7

  • Fixes a bug that go_router would crash if GoRoute.pageBuilder depends on InheritedWidgets.

6.5.6

  • Fixes an issue where ShellRoute routes were not logged when debugLogDiagnostic was enabled.

6.5.5

  • Fixes an issue when popping pageless route would accidentally complete imperative page.

6.5.4

  • Removes navigator keys from TypedGoRoute and TypedShellRoute.

6.5.3

  • Fixes redirect being called with an empty location for unknown routes.

6.5.2

  • NoTransitionPage now has an instant reverse transition.

6.5.1

  • Fixes an issue where the params are removed after popping.

6.5.0

  • Supports returning values on pop.

6.4.1

  • Adds initialExtra to GoRouter to pass extra data alongside initialRoute.

6.4.0

  • Adds replace method to that replaces the current route with a new one and keeps the same page key. This is useful for when you want to update the query params without changing the page key (#115902).

6.3.0

  • Aligns Dart and Flutter SDK constraints.
  • Updates compileSdkVersion to 33.
  • Updates example app to iOS 11.
  • Adds navigatorKey to TypedShellRoute
  • Adds parentNavigatorKey to TypedGoRoute
  • Updates documentation in matching methods.

6.2.0

  • Exports supertypes in route_data.dart library.

6.1.0

  • Adds GoRouter.maybeOf to get the closest GoRouter from the context, if there is any.

6.0.10

  • Adds helpers for go_router_builder for ShellRoute support

6.0.9

  • Fixes deprecation message for GoRouterState.namedLocation

6.0.8

  • Adds support for Iterables, Lists and Sets in query params for TypedGoRoute. #108437.

6.0.7

  • Add observers parameter to the ShellRoute that will be passed to the nested Navigator.
  • Use HeroControllerScope for nested Navigator that fixes Hero Widgets not animating in Nested Navigator.

6.0.6

  • Adds reverseTransitionDuration to CustomTransitionPage

6.0.5

6.0.4

  • Fixes redirection info log.

6.0.3

  • Makes CustomTransitionPage.barrierDismissible work

6.0.2

  • Fixes missing result on pop in go_router extension.

6.0.1

  • Fixes crashes when popping navigators manually.
  • Fixes trailing slashes after pops.

6.0.0

  • BREAKING CHANGE
    • GoRouteData's redirect now takes 2 parameters BuildContext context, GoRouterState state.
    • GoRouteData's build now takes 2 parameters BuildContext context, GoRouterState state.
    • GoRouteData's buildPageWithState has been removed and replaced by buildPage with now takes 2 parameters BuildContext context, GoRouterState state.
    • replace from GoRouter, GoRouterDelegate and GoRouterHelper has been renamed into pushReplacement.
    • replaceNamed from GoRouter, GoRouterDelegate and GoRouterHelper has been renamed into pushReplacementNamed.
    • go_router v6 migration guide

5.2.4

  • Fixes crashes when using async redirect.

5.2.3

  • Fixes link for router configuration and sub-routes

5.2.2

  • Fixes pop and push to update urls correctly.

5.2.1

  • Refactors GoRouter.pop to be able to pop individual pageless route with result.

5.2.0

  • Fixes GoRouterState.location and GoRouterState.param to return correct value.
  • Cleans up RouteMatch and RouteMatchList API.

5.1.10

  • Fixes link of ShellRoute in README.

5.1.9

  • Fixes broken links in documentation.

5.1.8

  • Fixes a bug with replace where it was not generated a new pageKey.

5.1.7

  • Adds documentation using dartdoc topics.

5.1.6

  • Fixes crashes when multiple GoRoutes use the same parentNavigatorKey in a route subtree.

5.1.5

  • Adds migration guide for 5.1.2 to readme.

5.1.4

  • Fixes the documentation by removing the ShellRoute's non-existing path parameter from it.

5.1.3

  • Allows redirection to return same location.

5.1.2

  • Adds GoRouterState to context.
  • Fixes GoRouter notification.
  • Updates README.
  • Removes dynamic calls in examples.
  • BREAKING CHANGE
    • Remove NavigatorObserver mixin from GoRouter

5.1.1

  • Removes DebugGoRouteInformation.

5.1.0

  • Removes urlPathStrategy completely, which should have been done in v5.0.0 but some code remained mistakenly.

5.0.5

  • Fixes issue where asserts in popRoute were preventing the app from exiting on Android.

5.0.4

  • Fixes a bug in ShellRoute example where NavigationBar might lose current index in a nested routes.

5.0.3

  • Changes examples to use the routerConfig API

5.0.2

  • Fixes missing code example in ShellRoute documentation.

5.0.1

  • Allows ShellRoute to have child ShellRoutes (flutter/flutter#111981)

5.0.0

  • Fixes a bug where intermediate route redirect methods are not called.
  • GoRouter implements the RouterConfig interface, allowing you to call MaterialApp.router(routerConfig: _myGoRouter) instead of passing the RouterDelegate, RouteInformationParser, and RouteInformationProvider fields.
  • BREAKING CHANGE
    • Redesigns redirection API, adds asynchronous feature, and adds build context to redirect.
    • Removes GoRouterRefreshStream
    • Removes navigatorBuilder
    • Removes urlPathStrategy
  • go_router v5 migration guide

4.5.1

  • Fixes an issue where GoRoutes with only a redirect were disallowed (flutter/flutter#111763)

4.5.0

  • Adds ShellRoute for nested navigation support (flutter/flutter#99126)
  • Adds parentNavigatorKey to GoRoute, which specifies the Navigator to place that route's Page onto.

4.4.1

  • Fix an issue where disabling logging clears the root logger's listeners

4.4.0

  • Adds buildPageWithState to GoRouteData.
  • GoRouteData.buildPage is now deprecated in favor of GoRouteData.buildPageWithState.

4.3.0

  • Allows Map<String, dynamic> maps as queryParams of goNamed, replacedName, pushNamed and namedLocation.

4.2.9

  • Updates text theme parameters to avoid deprecation issues.
  • Fixes lint warnings.

4.2.8

  • Fixes namedLocation to return URIs without trailing question marks if there are no query parameters.
  • Cleans up examples.

4.2.7

  • Updates README.

4.2.6

  • Fixes rendering issues in the README.

4.2.5

  • Fixes a bug where calling extra parameter is always null in route level redirect callback

4.2.4

  • Rewrites Readme and examples.

4.2.3

  • Fixes a bug where the ValueKey to be the same when a page was pushed multiple times.

4.2.2

  • Fixes a bug where go_router_builder wasn't detecting annotations.

4.2.1

  • Refactors internal classes and methods

4.2.0

  • Adds void replace() and replaceNamed to GoRouterDelegate, GoRouter and GoRouterHelper.

4.1.1

  • Fixes a bug where calling namedLocation does not support case-insensitive way.

4.1.0

  • Adds bool canPop() to GoRouterDelegate, GoRouter and GoRouterHelper.

4.0.3

  • Adds missed popping log.

4.0.2

  • Fixes a bug where initialLocation took precedence over deep-links

4.0.1

  • Fixes a bug where calling setLogging(false) does not clear listeners.

4.0.0

  • Refactors go_router and introduces GoRouteInformationProvider. Migration Doc
  • Fixes a bug where top-level routes are skipped if another contains child routes.

3.1.1

  • Uses first match if there are more than one route to match. [ #99833

3.1.0

  • Adds GoRouteData and TypedGoRoute to support package:go_router_builder.

3.0.7

  • Refactors runtime checks to assertions.

3.0.6

  • Exports inherited_go_router.dart file.

3.0.5

  • Add dispatchNotification method to DummyBuildContext in tests. (This should be revisited when Flutter 2.11.0 becomes stable.)
  • Improves code coverage.
  • GoRoute now warns about requiring either pageBuilder, builder or redirect at instantiation.

3.0.4

  • Updates code for stricter analysis options.

3.0.3

  • Fixes a bug where params disappear when pushing a nested route.

3.0.2

  • Moves source to flutter/packages.
  • Removes all_lint_rules_community and path_to_regexp dependencies.

3.0.1

  • pass along the error to the navigatorBuilder to allow for different implementations based on the presence of an error

3.0.0

  • breaking change: added GoRouterState to navigatorBuilder function
  • breaking change: removed BuildContext from GoRouter.pop() to remove the need to use context parameter when calling the GoRouter API; this changes the behavior of GoRouter.pop() to only pop what's on the GoRouter page stack and no longer calls Navigator.pop()
  • new Migrating to 3.0 section in the docs to describe the details of the breaking changes and how to update your code
  • added a new shared scaffold sample to show how to use the navigatorBuilder function to build a custom shared scaffold outside of the animations provided by go_router

2.5.7

  • PR 262: add support for Router.neglect; thanks to nullrocket!
  • PR 265: add Japanese translation of the docs; thanks to toshi-kuji! Unfortunately I don't yet know how to properly display them via docs.page, but I'm working on it
  • updated the examples using the from query parameter to be completely self-contained in the redirect function, simplifying usage
  • updated the async data example to be simpler
  • added a new example to show how to implement a loading page
  • renamed the navigator_integration example to user_input and added an example of WillPopScope for go_router apps

2.5.6

  • PR 259: remove a hack for notifying the router of a route change that was no longer needed; thanks to nullrocket!
  • improved async example to handle the case that the data has been returned but the page is no longer there by checking the mounted property of the screen

2.5.5

  • updated implementation to use logging package for debug diagnostics; thanks to johnpryan

2.5.4

  • fixed up the GoRouterRefreshStream implementation with an export, an example and some docs

2.5.3

  • added GoRouterRefreshStream from jopmiddelkamp to easily map from a Stream to a Listenable for use with refreshListenable; very useful when combined with stream-based state management like flutter_bloc
  • dartdocs fixups from mehade369
  • example link fixes from ben-milanko

2.5.2

  • pass additional information to the NavigatorObserver via default args to MaterialPage, etc.

2.5.1

  • fix 205: hack around a failed assertion in Flutter when using Duration.zero in the NoTransitionPage

2.5.0

  • provide default implementation of GoRoute.pageBuilder to provide a simpler way to build pages via the GoRouter.build method
  • provide default implementation of GoRouter.errorPageBuilder to provide a simpler way to build error pages via the GoRouter.errorBuilder method
  • provide default implementation of GoRouter.errorBuilder to provide an error page without the need to implement a custom error page builder
  • new Migrating to 2.5 section in the docs to show how to take advantage of the new builder and default error page builder
  • removed launch.json as VSCode-centric and unnecessary for discovery or easy launching
  • added a new custom error screen sample
  • added a new WidgetsApp sample
  • added a new NoTransitionPage class
  • updated docs to explain why the browser's Back button doesn't work with the extra param
  • updated README to point to new docs site: gorouter.dev

2.3.1

  • fix 191: handle several kinds of trailing / in the location, e.g. /foo/ should be the same as /foo

2.3.0

  • fix a misleading error message when using redirect functions with sub-routes

2.2.9

  • fix 182: fixes a regression in the nested navigation caused by the fix for #163; thanks to lulupointu for the fix!

2.2.8

  • reformatted CHANGELOG file; lets see if pub.dev is still ok with it...
  • staged an in-progress doc site at https://docs.page/csells/go_router
  • tightened up a test that was silently failing
  • fixed a bug that dropped parent params in sub-route redirects

2.2.7

  • fix 163: avoids unnecessary page rebuilds
  • fix 139: avoids unnecessary page flashes on deep linking
  • fix 158: shows exception info in the debug output even during a top-level redirect coded w/ an anonymous function, i.e. what the samples all use
  • fix 151: exposes Navigator.pop() via GoRouter.pop() to make it easy to find

2.2.6

  • fix 127: updated the docs to add a video overview of the project for people that prefer that media style over long-form text when approaching a new topic
  • fix 108: updated the description of the state parameter to clarfy that not all properties will be set at every usage

2.2.5

  • fix 120 again: found the bug in my tests that was masking the real bug; changed two characters to implement the actual fix (sigh)

2.2.4

  • fix 116: work-around for auto-import of the context.go family of extension methods

2.2.3

  • fix 132: route names are stored as case insensitive and are now matched in a case insensitive manner

2.2.2

  • fix 120: encoding and decoding of params and query params

2.2.1

2.2.0

2.1.2

  • fix 61 again: enable images and file links to work on pub.dev/documentation
  • fix 62 re-tested; fixed w/ earlier Android system Back button fix (using navigation key)
  • fix 91: fix a regression w/ the errorPageBuilder
  • fix 92: fix an edge case w/ named sub-routes
  • fix 89: enable queryParams and extra object param w/ push
  • refactored tests for greater coverage and fewer methods @visibleForTesting

2.1.1

  • fix 86: add name to GoRouterState to complete support for URI-free navigation knowledge in your code
  • fix 83: fix for null extra object

2.1.0

  • fix 80: adding a redirect limit to catch too many redirects error
  • fix 81: allow an extra object to pass through for navigation

2.0.1

  • add badges to the README and codecov to the GitHub commit action; thanks to rydmike for both

2.0.0

  • BREAKING CHANGE and fix #50: split params into params and queryParams; see the Migrating to 2.0 section of the docs for instructions on how to migrate your code from 1.x to 2.0
  • fix 69: exposed named location lookup for redirection
  • fix 57: enable the Android system Back button to behave exactly like the AppBar Back button; thanks to SunlightBro for the one-line fix that I had no idea about until he pointed it out
  • fix 59: add query params to top-level redirect
  • fix 44: show how to use the AutomaticKeepAliveClientMixin with nested navigation to keep widget state between navigations; thanks to rydmike for this update

1.1.3

  • enable case-insensitive path matching while still preserving path and query parameter cases
  • change a lifetime of habit to sort constructors first as per sort_constructors_first. Thanks for the PR, Abhishek01039!
  • set the initial transition example route to /none to make pushing the 'fade transition' button on the first run through more fun
  • fixed an error in the async data example

1.1.2

  • Thanks, Mikes!

1.1.1

  • now showing routing exceptions in the debug log
  • updated the docs to make it clear that it will be called until it returns null

1.1.0

  • added support NavigatorObserver objects to receive change notifications

1.0.1

  • docs updates based on user feedback for clarity
  • fix for setting URL path strategy in main()
  • fix for push() disables AppBar Back button

1.0.0

  • updated version for initial release
  • some renaming for clarify and consistency with transitions
    • GoRoute.builder => GoRoute.pageBuilder
    • GoRoute.error => GoRoute.errorPageBuilder
  • added diagnostic logging for push and pushNamed

0.9.6

  • added support for push as well as go
  • added 'none' to transitions example app
  • updated animation example to use no transition and added an animated gif to the docs

0.9.5

  • added support for custom transitions between routes

0.9.4

  • updated API docs
  • updated docs for GoRouterState

0.9.3

  • updated API docs

0.9.2

  • updated named route lookup to O(1)
  • updated diagnostics output to show known named routes

0.9.1

  • updated diagnostics output to show named route lookup
  • docs updates

0.9.0

  • added support for named routes

0.8.8

  • fix to make GoRouter notify on pop

0.8.7

  • made GoRouter a ChangeNotifier so you can listen for location changes

0.8.6

  • books sample bug fix

0.8.5

  • added Cupertino sample
  • added example of async data lookup

0.8.4

  • added state restoration sample

0.8.3

  • changed debugOutputFullPaths to debugLogDiagnostics and added add'l debugging logging
  • parameterized redirect

0.8.2

  • updated docs for Link widget support

0.8.1

  • added Books sample; fixed some issues it revealed

0.8.0

  • breaking build to refactor the API for simplicity and capability
  • move to fixed routing from conditional routing; simplies API, allows for redirection at the route level and there scenario was sketchy anyway
  • add redirection at the route level
  • replace guard objects w/ redirect functions
  • add refresh method and refreshListener
  • removed .builder ctor from GoRouter (not reasonable to implement)
  • add Dynamic linking section to the docs
  • replaced Books sample with Nested Navigation sample
  • add ability to dump the known full paths to your routes to debug output

0.7.1

  • update to pageKey to take sub-routes into account

0.7.0

  • BREAK: rename pattern to path for consistency w/ other routers in the world
  • added the GoRouterLoginGuard for the common redirect-to-login-page pattern

0.6.2

  • fixed issue showing home page for a second before redirecting (if needed)

0.6.1

  • added GoRouterState.pageKey
  • removed cupertino_icons from main pubspec.yaml

0.6.0

  • refactor to support sub-routes to build a stack of pages instead of matching multiple routes
  • added unit tests for building the stack of pages
  • some renaming of the types, e.g. Four04Page and FamiliesPage to ErrorPage and HomePage respectively
  • fix a redirection error shown in the debug output

0.5.2

  • add urlPathStrategy argument to GoRouter ctor

0.5.1

  • docs and description updates

0.5.0

  • moved redirect to top-level instead of per route for simplicity

0.4.1

  • fixed CHANGELOG formatting

0.4.0

  • bundled various useful route handling variables into the GoRouterState for use when building pages and error pages
  • updated URL Strategy section of docs to reference flutter run

0.3.2

  • formatting update to appease the pub.dev gods...

0.3.1

  • updated the CHANGELOG

0.3.0

  • moved redirection into a GoRoute ctor arg
  • forgot to update the CHANGELOG

0.2.3

  • move outstanding issues to issue tracker
  • added explanation of Deep Linking to docs
  • reformatting to meet pub.dev scoring guidelines

0.2.2

  • docs updates

0.2.1

  • messing with the CHANGELOG formatting

0.2.0

  • initial useful release
  • added support for declarative routes via GoRoute instances
  • added support for imperative routing via GoRoute.builder
  • added support for setting the URL path strategy
  • added support for conditional routing
  • added support for redirection
  • added support for optional query parameters as well as positional parameters in route names

0.1.0

  • squatting on the package name (I'm not too proud to admit it)

Installing

export PUB_HOSTED_URL=https://pub.mirror.p-hatan.ir
flutter pub add 'go_router:18.1.0'
pubspec.yaml
name: go_router
description: A declarative router for Flutter based on Navigation 2 supporting
  deep linking, data-driven routes and more
version: 18.1.0
repository: https://github.com/flutter/packages/tree/main/packages/go_router
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+go_router%22

environment:
  sdk: ^3.12.0
  flutter: ">=3.44.0"

dependencies:
  collection: ^1.15.0
  cupertino_ui: ^1.0.0
  flutter:
    sdk: flutter
  flutter_web_plugins:
    sdk: flutter
  logging: ^1.0.0
  material_ui: ^1.0.0
  meta: ^1.7.0

dev_dependencies:
  flutter_test:
    sdk: flutter
  io: ^1.0.4
  leak_tracker_flutter_testing: any
  path: ^1.8.2

topics:
  - deep-linking
  - go-router
  - navigation

Version history

VersionPublishedArchiveSHA-256
0.0.1On demandDownload68ffe73e…c2bff8
0.2.0On demandDownload9e509c9c…380810
0.2.1On demandDownloadfeb3a42e…24efd0
0.2.2On demandDownload1d776eb3…8bfcaa
0.2.3On demandDownload4e4d0c5a…55c301
0.3.0On demandDownload43b7fa1a…e95e76
0.3.1On demandDownload2e402939…ac28cb
0.3.2On demandDownload92007a6c…999216
0.4.0On demandDownloadfdfff50f…954eca
0.4.1On demandDownload2d924580…2da37c
0.5.0On demandDownload2e2ae901…b528cb
0.5.1On demandDownload877f6fde…5dda7e
0.5.2On demandDownload0b443123…558b40
0.6.0On demandDownloadbd74a7f9…704d74
0.6.1On demandDownload380e9fb8…317d1e
0.6.2On demandDownload9c322a3b…7a7845
0.7.0On demandDownloadcee999b2…eb7881
0.7.1On demandDownloaddc12ac5d…331b5c
0.8.0On demandDownload1334c325…bd3a05
0.8.1On demandDownloadd8807acc…6f3ab3
0.8.2On demandDownload3383ce20…1bdcb4
0.8.3On demandDownload123dcde1…7b72d1
0.8.4On demandDownload5ca38718…73ba1f
0.8.5On demandDownloade55f96fa…560de7
0.8.6On demandDownloadcc14cd9e…0c4ac0
0.8.7On demandDownload2413d982…f1976f
0.8.8On demandDownload6e4c064d…c20c01
0.9.0On demandDownload050e6046…3bde50
0.9.1On demandDownload5b51900f…cd12c7
0.9.2On demandDownloada1dc3527…bb3409
0.9.3On demandDownload2fcee509…acf11b
0.9.4On demandDownloade9b0ad5d…d7dc54
0.9.5On demandDownload2c07dc8f…acb8e6
0.9.6On demandDownloadbd44ae2b…bd6f1e
1.0.0On demandDownload410ca1c5…7bef94
1.0.1On demandDownloadbd5abffa…cf92c4
1.1.0On demandDownloada9526fdc…b4ae92
1.1.1On demandDownload180817e4…891486
1.1.2On demandDownload417cd8a1…4df6b5
1.1.3On demandDownload4bf6b762…bd5606
2.0.0On demandDownload713d8221…56ded4
2.0.1On demandDownloadd54cb8fb…a5a8a0
2.1.0On demandDownloadbbdf6e95…d01cbe
2.1.1On demandDownloadffdfa612…f8ed99
2.1.2On demandDownload7d06f64a…218459
2.2.0On demandDownload34485869…d718d2
2.2.1On demandDownloadd2a90a7f…15dbe1
2.2.2On demandDownload94c28803…97b6cb
2.2.3On demandDownloadcb5c7832…17ba47
2.2.4On demandDownload40782ed0…85ea12
2.2.5On demandDownload775ca00e…fe43b8
2.2.6On demandDownload303807b3…72fcbd
2.2.7On demandDownload392aae76…fe5583
2.2.8On demandDownloadd7bf4b71…748f2d
2.2.9On demandDownloadec1aed9a…fc4e9e
2.3.0On demandDownload6ba2058b…3647ae
2.3.1On demandDownload8efcdefa…5e5f4e
2.5.0On demandDownload0fde37c6…e681e1
2.5.1On demandDownloadf5abc59e…6e35aa
2.5.2On demandDownload1b4513a3…22fac4
2.5.3On demandDownload1eb95a92…c56a15
2.5.4On demandDownloadb749cd26…ddc894
2.5.5On demandDownloadbf34a444…065a63
2.5.6On demandDownload39ceca43…6e3f43
2.5.7On demandDownload67b83df7…dd3f0f
3.0.0On demandDownloadc17ecf9c…389a61
3.0.1On demandDownloadff9439a1…baf5de
3.0.2On demandDownload7b29937a…55037f
3.0.3On demandDownload5f04c7cf…511f71
3.0.4On demandDownload9929bf23…24f211
3.0.5On demandDownloadce35f84f…42a71c
3.0.6On demandDownload3d8d0e66…bee1d5
3.0.7On demandDownload070cba56…ac0143
3.1.0On demandDownload403e9b49…d2d972
3.1.1On demandDownload25ae2138…6fd1ca
4.0.0On demandDownloadaa9a1ca4…18d955
4.0.1On demandDownload41266e0c…54ed88
4.0.2On demandDownloadabffa22d…4fb85e
4.0.3On demandDownloada3f53f83…f362f8
4.1.0On demandDownload7e145378…ab4987
4.1.1On demandDownload654638dc…a2d09d
4.2.0On demandDownload83375198…34f1ce
4.2.1On demandDownload541f4c57…4271dc
4.2.2On demandDownloade9deecd6…b9a865
4.2.3On demandDownloadcc273dfc…3624fa
4.2.4On demandDownloadfe541eae…97671b
4.2.5On demandDownload47f3f77b…abc7ed
4.2.6On demandDownloadd3aef28d…7ec750
4.2.7On demandDownloade5f31b60…420075
4.2.8On demandDownloadd8436bc4…3f50ec
4.2.9On demandDownloade43ae26b…550c31
4.3.0On demandDownloadbfd09217…cee275
4.4.1On demandDownload96ba0c54…d7e2c8
4.5.0On demandDownloada33f977c…7cda43
4.5.1On demandDownloadaec1999a…0ce489
5.0.0On demandDownload970408ce…46689a
5.0.1On demandDownload2049b076…22eb53
5.0.2On demandDownloadb1e54e29…064bdd
5.0.3On demandDownload56ae3ab2…ca6ce0
5.0.4On demandDownload3d458236…2b05c6
5.0.5On demandDownload8aa73f93…379ea4
5.1.0On demandDownload6bef36aa…2594d7
5.1.1On demandDownload406f180e…d69d39
5.1.2On demandDownload08ad3f57…479695
5.1.3On demandDownloada35dc8d3…2279f3
5.1.4On demandDownloadb7e874b7…33a615
5.1.5On demandDownloade33399a4…97aa60
5.1.6On demandDownload6d8aa4d3…577e6b
5.1.7On demandDownloadf34bdab1…ed1dff
5.1.8On demandDownload635392e2…8cd147
5.1.9On demandDownload426efbfe…434db4
5.1.10On demandDownloadcc97ff57…b703f2
5.2.0On demandDownloadb96c2527…ddd70c
5.2.1On demandDownload22c72f83…beb672
5.2.2On demandDownload3afa958b…a09dcb
5.2.3On demandDownload7020dfc9…44ea97
5.2.4On demandDownload6d1607d7…006fc3
6.0.0On demandDownload788a8993…0c4e01
6.0.1On demandDownloadf611d439…151f4a
6.0.2On demandDownloadb789ead5…5e9d3e
6.0.3On demandDownload9e8cee99…b0e095
6.0.4On demandDownload54ecc1cd…42be12
6.0.5On demandDownload313e5899…557f03
6.0.6On demandDownload5a0b2e0b…634c27
6.0.7On demandDownload6dd6b05d…6ef34f
6.0.8On demandDownload22c1e44f…6c11ce
6.0.9On demandDownload7a792328…0b0ccc
6.0.10On demandDownloadf48051e2…295577
6.1.0On demandDownload886aa8ea…95072c
6.2.0On demandDownloadb4bb0620…ae37e2
6.3.0On demandDownload871f6f89…2df409
6.4.0On demandDownloadb90b9aaa…4733ea
6.4.1On demandDownloade2a90e1d…fb8af8
6.5.0On demandDownload43240951…277139
6.5.1On demandDownload7f25c4bb…a21480
6.5.2On demandDownload6af43e09…6b98c2
6.5.3On demandDownloaddc9be827…9616d5
6.5.4On demandDownload96ba6bf3…7bc793
6.5.5On demandDownloadfeab99a2…82c6bc
6.5.6On demandDownload50bc08b7…1c5620
6.5.7On demandDownload99c7fbd4…79af40
6.5.8On demandDownload4d141302…827c28
6.5.9On demandDownloadbd7e671d…2a7ee5
7.0.0On demandDownload73a50070…1e75e3
7.0.1On demandDownload80e37516…bf199b
7.0.2On demandDownloadb185cf91…e1588d
7.1.0On demandDownload3d5c9dc0…2ed82e
7.1.1On demandDownload00d1b67d…5722c3
8.0.0On demandDownloadabc95b13…70bb5b
8.0.1On demandDownload9235e40f…884c5c
8.0.2On demandDownloadfe2d5f3e…071e36
8.0.3On demandDownloadd687b612…923c51
8.0.4On demandDownloadd27d09c8…847b78
8.0.5On demandDownloadda08429b…6f35ed
8.1.0On demandDownloadcf6a8762…7cc2a4
8.2.0On demandDownload2cb236ba…5847e5
9.0.0On demandDownload15315426…a62906
9.0.1On demandDownloaddf5bc28e…d954b6
9.0.2On demandDownloadde9c31ce…c41a03
9.0.3On demandDownloadb33a88c6…af8ea0
9.1.0On demandDownload5927202c…9f1730
9.1.1On demandDownloadedbceb4c…7baad2
10.0.0On demandDownloadb3cadd2c…7d5475
10.1.0On demandDownload2aa88466…3eea14
10.1.1On demandDownload694cb219…c59ccb
10.1.2On demandDownload5668e6d3…017d5b
10.1.3On demandDownload20473e33…05f39f
10.1.4On demandDownloadce2aa227…057d81
10.2.0On demandDownloade1a30a66…0bcf1f
11.0.0On demandDownload24d89757…c9d9bd
11.0.1On demandDownload02361e07…51a68b
11.1.0On demandDownload666f3a48…a4bd30
11.1.1On demandDownload4b58412b…77e16e
11.1.2On demandDownloada07c781b…5d8393
11.1.3On demandDownload1bd28265…b31f0c
11.1.4On demandDownload2ccd7448…6b4407
12.0.0On demandDownloada206cc46…fccab1
12.0.1On demandDownloade156bc1b…8205d1
12.0.2On demandDownload3c943793…1a3acb
12.0.3On demandDownloadd3f19eae…88b137
12.1.0On demandDownload5098760d…ee33bc
12.1.1On demandDownloadc247a4f7…874895
12.1.3On demandDownloadc5fa45fa…0f7b15
13.0.0On demandDownloadca7e4a22…5830fd
13.0.1On demandDownload3b40e751…8c803a
13.1.0On demandDownload07ee2436…594075
13.2.0On demandDownload170c46e2…8b176a
13.2.1On demandDownload7ecb2f39…b2d3f8
13.2.2On demandDownload5ed2687b…556b85
13.2.3On demandDownloadf6ba8eed…2e6673
13.2.4On demandDownload771c8feb…e40446
13.2.5On demandDownloadb465e99c…99e836
14.0.0On demandDownload28ef8a83…a792c8
14.0.1On demandDownload466425a6…ff9c51
14.0.2On demandDownload9e0f7d1a…113c1e
14.1.0On demandDownload81f94e16…b46734
14.1.1On demandDownload7685acd0…85b17c
14.1.2On demandDownloadaa073287…b4df65
14.1.3On demandDownload6ad5662b…539e86
14.1.4On demandDownloadabec47eb…12fe3f
14.2.0On demandDownloadcdae1b9c…5b5554
14.2.1On demandDownload39dd5216…ce1ba8
14.2.2On demandDownloadd380de03…efa722
14.2.3On demandDownloadddc16d34…44ccfe
14.2.5On demandDownload604910f5…d14f9b
14.2.6On demandDownload48d03a1e…a64034
14.2.7On demandDownload2ddb88e9…2ff459
14.2.8On demandDownload5cf5fdcf…e55ab6
14.2.9On demandDownloadb4c1cce7…5b389d
14.3.0On demandDownload6f1b756f…dc8bbc
14.4.0On demandDownload5a741923…4ef52e
14.4.1On demandDownloadce89c5a9…cac2a4
14.5.0On demandDownload844a216e…b01bb7
14.6.0On demandDownload8ae664a7…f4fef5
14.6.1On demandDownload8660b741…534d9d
14.6.2On demandDownload2fd11229…b46539
14.6.3On demandDownload7c2d40b5…67472d
14.7.0On demandDownloadc580c88e…e80313
14.7.1On demandDownloaddaf3ff55…a81550
14.7.2On demandDownload9b736a9f…731eaa
14.8.0On demandDownload04539267…ebd651
14.8.1On demandDownloadf02fd7d2…1634b3
15.0.0On demandDownload4cdfcc6a…277732
15.1.0On demandDownload1df05e1e…89100d
15.1.1On demandDownload2b9ba6d4…4112b6
15.1.2On demandDownload0b1e0622…11429a
15.1.3On demandDownloadb453934c…999175
15.2.0On demandDownloadf222e12c…c91813
15.2.1On demandDownload58e2a452…94f7f4
15.2.2On demandDownloadb66a642f…737c5b
15.2.3On demandDownload02ff498f…868ddf
15.2.4On demandDownloadac294be3…e99ebf
16.0.0On demandDownloadc489908a…489431
16.1.0On demandDownload8b1f37df…ec2b48
16.2.0On demandDownloadced3fdc1…51c6b9
16.2.1On demandDownloadeb059dfe…9ad227
16.2.2On demandDownloadb1488741…3f92a3
16.2.3On demandDownload41295208…feaa09
16.2.4On demandDownloadc752e2d0…5ddd23
16.2.5On demandDownloade1d7ffb0…7f70ea
16.3.0On demandDownloadd8f590a6…660d7c
17.0.0On demandDownloadc92d18e1…620104
17.0.1On demandDownloadeff94d2a…745f2a
17.1.0On demandDownload7974313e…f00896
17.2.0On demandDownload48fb2f42…18ffc4
17.2.1On demandDownload5540e4a3…e88735
17.2.2On demandDownload08b742ee…813b79
17.2.3On demandDownload92d8cee7…62d03f
17.3.0On demandDownload5922b286…5a9e8a
17.4.0On demandDownload55973bf1…a29ee9
17.5.0On demandDownloadd7a3576c…eef7ea
18.0.0On demandDownload2e7fcb9a…2b5bf3
18.0.1On demandDownload008ab21d…c225b5
18.0.2On demandDownload530dcbb2…e230f1
18.1.0Cached · Upstream SHA-256 matchedDownload8b05bc90…c6dbe7
18.1.1On demandDownload07089be6…aaece0
18.1.2On demandDownloadf1c2d3c2…26d872

Dependencies

collection "^1.15.0"

cupertino_ui "^1.0.0"

flutter { "sdk": "flutter" }

flutter_web_plugins { "sdk": "flutter" }

logging "^1.0.0"

material_ui "^1.0.0"

meta "^1.7.0"