1
0
mirror of https://github.com/flutter/samples.git synced 2025-11-12 07:48:55 +00:00

Update navigation_and_routing sample to go_router (#2067)

This is a new PR to update the navigation_and_routing sample to the
latest version of go_router. It is a based on
https://github.com/flutter/samples/pull/1437

---------

Co-authored-by: Brett Morgan <brettmorgan@google.com>
This commit is contained in:
John Ryan
2023-11-01 12:14:00 -07:00
committed by GitHub
parent 3e4e3bc784
commit 49eebf8c20
18 changed files with 332 additions and 733 deletions

View File

@@ -51,6 +51,10 @@ class Library {
allBooks.add(book);
}
Book getBook(String id) {
return allBooks[int.parse(id)];
}
List<Book> get popularBooks => [
...allBooks.where((book) => book.isPopular),
];