1
0
mirror of https://github.com/flutter/samples.git synced 2026-07-16 05:52:01 +00:00

navigation_and_routing: a bunch of cleanup (#886)

Fail early on nullable context objects - no code paths allow null
Eliminate superfluous private function
Use a function over an abstract class with one method
This commit is contained in:
Kevin Moore
2021-08-26 16:14:29 -07:00
committed by GitHub
parent ad6dc454f2
commit ecf716dcab
13 changed files with 84 additions and 122 deletions

View File

@@ -21,7 +21,7 @@ class AuthorsScreen extends StatelessWidget {
body: AuthorList(
authors: LibraryScope.of(context).allAuthors,
onTap: (author) {
RouteStateScope.of(context)!.go('/author/${author.id}');
RouteStateScope.of(context).go('/author/${author.id}');
},
),
);