Hide routes from the API when they're not needed. (#3431)

The 'routes' table is a point of confusion with new developers. By
providing a 'home' argument that sets the '/' route, we can delay the
point at which we teach developers about 'routes' until the point where
they want to have a second route.
This commit is contained in:
Ian Hickson
2016-04-20 09:33:28 -07:00
parent f7360126b8
commit 1b9476c4d9
22 changed files with 553 additions and 517 deletions

View File

@@ -24,9 +24,7 @@ class ComplexLayoutAppState extends State<ComplexLayoutApp> {
return new MaterialApp(
theme: lightTheme ? new ThemeData.light() : new ThemeData.dark(),
title: 'Advanced Layout',
routes: <String, WidgetBuilder>{
'/': (BuildContext context) => new ComplexLayout(),
}
home: new ComplexLayout()
);
}