@@ -63,7 +63,7 @@ class Bookstore extends StatelessWidget {
6363 GoRoute (
6464 path: '/book/:bookId' ,
6565 redirect: (BuildContext context, GoRouterState state) =>
66- '/books/all/${state .params ['bookId' ]}' ,
66+ '/books/all/${state .pathParameters ['bookId' ]}' ,
6767 ),
6868 GoRoute (
6969 path: '/books/:kind(new|all|popular)' ,
@@ -72,14 +72,14 @@ class Bookstore extends StatelessWidget {
7272 key: _scaffoldKey,
7373 child: BookstoreScaffold (
7474 selectedTab: ScaffoldTab .books,
75- child: BooksScreen (state.params ['kind' ]! ),
75+ child: BooksScreen (state.pathParameters ['kind' ]! ),
7676 ),
7777 ),
7878 routes: < GoRoute > [
7979 GoRoute (
8080 path: ':bookId' ,
8181 builder: (BuildContext context, GoRouterState state) {
82- final String bookId = state.params ['bookId' ]! ;
82+ final String bookId = state.pathParameters ['bookId' ]! ;
8383 final Book ? selectedBook = libraryInstance.allBooks
8484 .firstWhereOrNull ((Book b) => b.id.toString () == bookId);
8585
@@ -91,7 +91,7 @@ class Bookstore extends StatelessWidget {
9191 GoRoute (
9292 path: '/author/:authorId' ,
9393 redirect: (BuildContext context, GoRouterState state) =>
94- '/authors/${state .params ['authorId' ]}' ,
94+ '/authors/${state .pathParameters ['authorId' ]}' ,
9595 ),
9696 GoRoute (
9797 path: '/authors' ,
@@ -107,7 +107,7 @@ class Bookstore extends StatelessWidget {
107107 GoRoute (
108108 path: ':authorId' ,
109109 builder: (BuildContext context, GoRouterState state) {
110- final int authorId = int .parse (state.params ['authorId' ]! );
110+ final int authorId = int .parse (state.pathParameters ['authorId' ]! );
111111 final Author ? selectedAuthor = libraryInstance.allAuthors
112112 .firstWhereOrNull ((Author a) => a.id == authorId);
113113
@@ -135,7 +135,7 @@ class Bookstore extends StatelessWidget {
135135
136136 String ? _guard (BuildContext context, GoRouterState state) {
137137 final bool signedIn = _auth.signedIn;
138- final bool signingIn = state.subloc == '/signin' ;
138+ final bool signingIn = state.matchedLocation == '/signin' ;
139139
140140 // Go to /signin if the user is not signed in
141141 if (! signedIn && ! signingIn) {
0 commit comments