Add Navigator.of

Now you don't need to pass the navigator around everywhere.
This commit is contained in:
Adam Barth
2015-10-22 11:17:20 -07:00
parent e44780e74d
commit cb9c87564c

View File

@@ -34,10 +34,6 @@ class Field extends StatelessComponent {
}
class AddressBookHome extends StatelessComponent {
AddressBookHome({ this.navigator });
final NavigatorState navigator;
Widget buildToolBar(BuildContext context) {
return new ToolBar(
left: new IconButton(icon: "navigation/arrow_back"),
@@ -96,7 +92,7 @@ void main() {
title: 'Address Book',
theme: theme,
routes: <String, RouteBuilder>{
'/': (RouteArguments args) => new AddressBookHome(navigator: args.navigator)
'/': (RouteArguments args) => new AddressBookHome()
}
));
}