From 9747469b94323194fe1f0268554dcbaab65b5973 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20P=2E=20Tjern=C3=B8?= Date: Fri, 17 Feb 2023 14:53:26 -0800 Subject: [PATCH] Fix deprecation message for GoRouterState.namedLocation (#3092) Fix deprecation message for `GoRouterState.namedLocation` -- it should point to `GoRouter.of(context).namedLocation`, not `GoRouter.of(context).routeInformationParser.namedLocation` (the latter does not exist). Previously mentioned here: https://github.com/flutter/packages/commit/bdc07b69d41ba01fd4a5759b96cab6080a9dec8b#r88804919 --- packages/go_router/CHANGELOG.md | 4 ++++ packages/go_router/lib/src/state.dart | 3 +-- packages/go_router/pubspec.yaml | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/go_router/CHANGELOG.md b/packages/go_router/CHANGELOG.md index 2d340dfb44..5b9c7d4bbd 100644 --- a/packages/go_router/CHANGELOG.md +++ b/packages/go_router/CHANGELOG.md @@ -1,3 +1,7 @@ +## 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](https://github.com/flutter/flutter/issues/108437). diff --git a/packages/go_router/lib/src/state.dart b/packages/go_router/lib/src/state.dart index 721565a5e6..fd8b904caf 100644 --- a/packages/go_router/lib/src/state.dart +++ b/packages/go_router/lib/src/state.dart @@ -122,8 +122,7 @@ class GoRouterState { /// Get a location from route name and parameters. /// This is useful for redirecting to a named location. - @Deprecated( - 'Uses GoRouter.of(context).routeInformationParser.namedLocation instead') + @Deprecated('Use GoRouter.of(context).namedLocation instead') String namedLocation( String name, { Map params = const {}, diff --git a/packages/go_router/pubspec.yaml b/packages/go_router/pubspec.yaml index d7d83e54a8..eddc3552f2 100644 --- a/packages/go_router/pubspec.yaml +++ b/packages/go_router/pubspec.yaml @@ -1,7 +1,7 @@ name: go_router description: A declarative router for Flutter based on Navigation 2 supporting deep linking, data-driven routes and more -version: 6.0.8 +version: 6.0.9 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