mirror of
https://github.com/flutter/samples.git
synced 2025-11-08 13:58:47 +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:
@@ -9,10 +9,26 @@ void main() {
|
||||
group('Library', () {
|
||||
test('addBook', () {
|
||||
final library = Library();
|
||||
library.addBook('Left Hand of Darkness', 'Ursula K. Le Guin', true, true);
|
||||
library.addBook('Too Like the Lightning', 'Ada Palmer', false, true);
|
||||
library.addBook('Kindred', 'Octavia E. Butler', true, false);
|
||||
library.addBook('The Lathe of Heaven', 'Ursula K. Le Guin', false, false);
|
||||
library.addBook(
|
||||
title: 'Left Hand of Darkness',
|
||||
authorName: 'Ursula K. Le Guin',
|
||||
isPopular: true,
|
||||
isNew: true);
|
||||
library.addBook(
|
||||
title: 'Too Like the Lightning',
|
||||
authorName: 'Ada Palmer',
|
||||
isPopular: false,
|
||||
isNew: true);
|
||||
library.addBook(
|
||||
title: 'Kindred',
|
||||
authorName: 'Octavia E. Butler',
|
||||
isPopular: true,
|
||||
isNew: false);
|
||||
library.addBook(
|
||||
title: 'The Lathe of Heaven',
|
||||
authorName: 'Ursula K. Le Guin',
|
||||
isPopular: false,
|
||||
isNew: false);
|
||||
expect(library.allAuthors.length, 3);
|
||||
expect(library.allAuthors.first.books.length, 2);
|
||||
expect(library.allBooks.length, 4);
|
||||
|
||||
Reference in New Issue
Block a user