[go_router] Update redirect documentation example code for clarity (#6213)
The redirection documentation page gives an example where the top level redirect may be used to send non-signed-in users to the signin page. The example code seems to be doing so for signed in users, however.
This is a documentation-only change.
diff --git a/packages/go_router/CHANGELOG.md b/packages/go_router/CHANGELOG.md
index d38b99e..1405fe7 100644
--- a/packages/go_router/CHANGELOG.md
+++ b/packages/go_router/CHANGELOG.md
@@ -1,3 +1,7 @@
+## 14.0.1
+
+- Updates the redirection documentation for clarity
+
## 14.0.0
- **BREAKING CHANGE**
diff --git a/packages/go_router/doc/redirection.md b/packages/go_router/doc/redirection.md
index e0ff022..c8398e0 100644
--- a/packages/go_router/doc/redirection.md
+++ b/packages/go_router/doc/redirection.md
@@ -10,7 +10,7 @@
```dart
redirect: (BuildContext context, GoRouterState state) {
- if (AuthState.of(context).isSignedIn) {
+ if (!AuthState.of(context).isSignedIn) {
return '/signin';
} else {
return null;
diff --git a/packages/go_router/pubspec.yaml b/packages/go_router/pubspec.yaml
index febb4db..bd53a5f 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.0.0
+version: 14.0.1
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