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:
@@ -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,
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user