1
0
mirror of https://github.com/flutter/samples.git synced 2025-11-08 13:58:47 +00:00

Did you mean to use .go here? (#857)

This commit is contained in:
idkq
2021-07-28 19:35:33 -04:00
committed by GitHub
parent a6ac643fe0
commit 228bc80b9a

View File

@@ -7,6 +7,7 @@ import 'package:flutter/material.dart';
import '../data.dart'; import '../data.dart';
import '../widgets/book_list.dart'; import '../widgets/book_list.dart';
import 'book_details.dart'; import 'book_details.dart';
import '../routing.dart';
class AuthorDetailsScreen extends StatelessWidget { class AuthorDetailsScreen extends StatelessWidget {
final Author author; final Author author;
@@ -29,15 +30,7 @@ class AuthorDetailsScreen extends StatelessWidget {
child: BookList( child: BookList(
books: author.books, books: author.books,
onTap: (book) { onTap: (book) {
Navigator.of(context).push<dynamic>( RouteStateScope.of(context)!.go('/book/${book.id}');
MaterialPageRoute<dynamic>(
builder: (context) {
return BookDetailsScreen(
book: book,
);
},
),
);
}, },
), ),
), ),