Skip to content

Commit 228bc80

Browse files
authored
Did you mean to use .go here? (#857)
1 parent a6ac643 commit 228bc80

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

navigation_and_routing/lib/src/screens/author_details.dart

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import 'package:flutter/material.dart';
77
import '../data.dart';
88
import '../widgets/book_list.dart';
99
import 'book_details.dart';
10+
import '../routing.dart';
1011

1112
class AuthorDetailsScreen extends StatelessWidget {
1213
final Author author;
@@ -29,15 +30,7 @@ class AuthorDetailsScreen extends StatelessWidget {
2930
child: BookList(
3031
books: author.books,
3132
onTap: (book) {
32-
Navigator.of(context).push<dynamic>(
33-
MaterialPageRoute<dynamic>(
34-
builder: (context) {
35-
return BookDetailsScreen(
36-
book: book,
37-
);
38-
},
39-
),
40-
);
33+
RouteStateScope.of(context)!.go('/book/${book.id}');
4134
},
4235
),
4336
),

0 commit comments

Comments
 (0)