From 7c1a05c8b12274e940e39adcb42896a32f57df32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=BF=9C=E6=B5=85?= <14177215+unliar@users.noreply.github.com> Date: Sat, 17 Aug 2024 06:21:20 +0800 Subject: [PATCH] [go_router] docs: replace out dated initialRoute to initialLocation (#7147) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ‌‌‌‌Updated the outdated configurations in [upgrading.md](https://github.com/flutter/packages/compare/main...unliar:packages:main#diff-0acd78ed04ed5af73daeb7496126c67bd4997e3068806c90d0385f323af20e7b). --- packages/go_router/CHANGELOG.md | 5 +++-- packages/go_router/doc/upgrading.md | 4 +++- packages/go_router/pubspec.yaml | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/go_router/CHANGELOG.md b/packages/go_router/CHANGELOG.md index 80b1a17e2845..4f9be82467fe 100644 --- a/packages/go_router/CHANGELOG.md +++ b/packages/go_router/CHANGELOG.md @@ -1,6 +1,7 @@ -## NEXT +## 14.2.4 -* Updates minimum supported SDK version to Flutter 3.19/Dart 3.3. +- Updates minimum supported SDK version to Flutter 3.19/Dart 3.3. +- Fix GoRouter configuration in `upgrading.md` ## 14.2.3 diff --git a/packages/go_router/doc/upgrading.md b/packages/go_router/doc/upgrading.md index 72af6b91137f..418c994e412b 100644 --- a/packages/go_router/doc/upgrading.md +++ b/packages/go_router/doc/upgrading.md @@ -3,6 +3,7 @@ home screen and creating a GoRoute for each screen you would like to be deep-linkable. # Upgrade an app that uses Navigator + To upgrade an app that is already using the Navigator for routing, start with a single route for the home screen: @@ -37,6 +38,7 @@ aren't deep-linkable. You can gradually add more routes to the GoRouter configuration. # Upgrade an app that uses named routes + An app that uses named routes can be migrated to go_router by changing each entry in the map to a GoRoute object and changing any calls to `Navigator.of(context).pushNamed` to `context.go()`. @@ -57,7 +59,7 @@ Then the GoRouter configuration would look like this: ```dart GoRouter( - initialRoute: '/details', + initialLocation: '/details', routes: [ GoRoute( path: '/', diff --git a/packages/go_router/pubspec.yaml b/packages/go_router/pubspec.yaml index 3209ed782ec7..e51710925133 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: 14.2.3 +version: 14.2.4 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