From 6f96933fb6690d28799c56c00dd253a3c2abb031 Mon Sep 17 00:00:00 2001 From: flyneko Date: Wed, 17 Jul 2024 11:26:33 +0800 Subject: [PATCH 1/4] [go_router] docs: replace out dated initialRoute to initialLocation --- packages/go_router/doc/upgrading.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/go_router/doc/upgrading.md b/packages/go_router/doc/upgrading.md index 72af6b91137..6063c353d67 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()`. @@ -45,7 +47,7 @@ For example, if you are starting with an app like this: ```dart MaterialApp( - initialRoute: '/details', + initialLocation: '/details', routes: { '/': (context) => HomeScreen(), '/details': (context) => DetailsScreen(), @@ -57,7 +59,7 @@ Then the GoRouter configuration would look like this: ```dart GoRouter( - initialRoute: '/details', + initialLocation: '/details', routes: [ GoRoute( path: '/', From ba8b07edc2f5d05f2a29f59fe8cdbf6d5d1827ad Mon Sep 17 00:00:00 2001 From: flyneko Date: Wed, 17 Jul 2024 11:31:56 +0800 Subject: [PATCH 2/4] Revert "[go_router] docs: replace out dated initialRoute to initialLocation" This reverts commit 6f96933fb6690d28799c56c00dd253a3c2abb031. --- packages/go_router/doc/upgrading.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/go_router/doc/upgrading.md b/packages/go_router/doc/upgrading.md index 6063c353d67..72af6b91137 100644 --- a/packages/go_router/doc/upgrading.md +++ b/packages/go_router/doc/upgrading.md @@ -3,7 +3,6 @@ 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: @@ -38,7 +37,6 @@ 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()`. @@ -47,7 +45,7 @@ For example, if you are starting with an app like this: ```dart MaterialApp( - initialLocation: '/details', + initialRoute: '/details', routes: { '/': (context) => HomeScreen(), '/details': (context) => DetailsScreen(), @@ -59,7 +57,7 @@ Then the GoRouter configuration would look like this: ```dart GoRouter( - initialLocation: '/details', + initialRoute: '/details', routes: [ GoRoute( path: '/', From 1fc732a1064b9a878ad33d4b2ac543c03c94a55d Mon Sep 17 00:00:00 2001 From: flyneko Date: Wed, 17 Jul 2024 11:45:22 +0800 Subject: [PATCH 3/4] [go_router] docs: replace out dated initialRoute to initialLocation --- packages/go_router/doc/upgrading.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/go_router/doc/upgrading.md b/packages/go_router/doc/upgrading.md index 72af6b91137..418c994e412 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: '/', From 7b7c2e26128710130fc4fb78c247e2a92fead64b Mon Sep 17 00:00:00 2001 From: flyneko Date: Fri, 19 Jul 2024 10:25:19 +0800 Subject: [PATCH 4/4] [go_router] docs: bumb the version and changelog --- packages/go_router/CHANGELOG.md | 4 ++++ packages/go_router/pubspec.yaml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/go_router/CHANGELOG.md b/packages/go_router/CHANGELOG.md index 1e2df530527..bf1da8bb16e 100644 --- a/packages/go_router/CHANGELOG.md +++ b/packages/go_router/CHANGELOG.md @@ -1,3 +1,7 @@ +## 14.2.2 + +- Fix GoRouter configuration in `upgrading.md` + ## 14.2.1 - Makes GoRouterState lookup more robust. diff --git a/packages/go_router/pubspec.yaml b/packages/go_router/pubspec.yaml index fc4f3508345..60d5443e09e 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.1 +version: 14.2.2 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