Skip to content

Commit ce74a85

Browse files
authored
[go_router] Update redirect documentation example code for clarity (flutter#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.
1 parent 981c1d5 commit ce74a85

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

packages/go_router/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 14.0.1
2+
3+
- Updates the redirection documentation for clarity
4+
15
## 14.0.0
26

37
- **BREAKING CHANGE**

packages/go_router/doc/redirection.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ either the GoRouter or GoRoute constructor:
1010

1111
```dart
1212
redirect: (BuildContext context, GoRouterState state) {
13-
if (AuthState.of(context).isSignedIn) {
13+
if (!AuthState.of(context).isSignedIn) {
1414
return '/signin';
1515
} else {
1616
return null;

packages/go_router/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: go_router
22
description: A declarative router for Flutter based on Navigation 2 supporting
33
deep linking, data-driven routes and more
4-
version: 14.0.0
4+
version: 14.0.1
55
repository: https://github.com/flutter/packages/tree/main/packages/go_router
66
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+go_router%22
77

0 commit comments

Comments
 (0)