mirror of
https://github.com/flutter/samples.git
synced 2025-11-11 23:39:14 +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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user