Skip to content

Commit

Permalink
[go_router] Update redirect documentation example code for clarity (#…
Browse files Browse the repository at this point in the history
…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.
  • Loading branch information
elitree committed Apr 25, 2024
1 parent 981c1d5 commit ce74a85
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions packages/go_router/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 14.0.1

- Updates the redirection documentation for clarity

## 14.0.0

- **BREAKING CHANGE**
Expand Down
2 changes: 1 addition & 1 deletion packages/go_router/doc/redirection.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ either the GoRouter or GoRoute constructor:

```dart
redirect: (BuildContext context, GoRouterState state) {
if (AuthState.of(context).isSignedIn) {
if (!AuthState.of(context).isSignedIn) {
return '/signin';
} else {
return null;
Expand Down
2 changes: 1 addition & 1 deletion packages/go_router/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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

Expand Down

0 comments on commit ce74a85

Please sign in to comment.