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

Update Navigation and Routing sample (#851)

* Add duration parameter to FadeTransitionPage

* Use didChangeDependencies instead of didUpdateWidget

* Don't notify listeners if the path hasn't changed

* Update navigation sample WIP

* Use Link and RouteStateScope in settings screen

* update README

* use named parameters for Library.addBook()

* Make _handleAuthStateChanged synchronous

* add missing copyright headers

* Address code review comments

* Address code review comments
This commit is contained in:
John Ryan
2021-07-12 14:22:53 -07:00
committed by GitHub
parent d3c4645a42
commit 35f1670098
17 changed files with 298 additions and 78 deletions

View File

@@ -11,7 +11,12 @@ class Library {
final List<Book> allBooks = [];
final List<Author> allAuthors = [];
void addBook(String title, String authorName, bool isPopular, bool isNew) {
void addBook({
required String title,
required String authorName,
required bool isPopular,
required bool isNew,
}) {
var author =
allAuthors.firstWhereOrNull((author) => author.name == authorName);
var book = Book(allBooks.length, title, isPopular, isNew);