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 9bbeac4dc2
commit 3fd0ba6a31

View File

@ -21,7 +21,7 @@ You can use [hyperlinks](hyperlink) in markdown
## Code blocks ## Code blocks
Formatted Dart code looks really pretty too. This is an example of how to create your own Markdown widget: Formatted Dart code looks really pretty too. This is an example of how to create your own Markdown widget:
new Markdown(data: "Hello _world_!"); new Markdown(data: 'Hello _world_!');
Enjoy! Enjoy!
"""; """;
@ -29,11 +29,9 @@ Enjoy!
void main() { void main() {
runApp(new MaterialApp( runApp(new MaterialApp(
title: "Markdown Demo", title: "Markdown Demo",
routes: <String, WidgetBuilder>{ home: new Scaffold(
'/': (BuildContext context) => new Scaffold( appBar: new AppBar(title: new Text('Markdown Demo')),
appBar: new AppBar(title: new Text("Markdown Demo")), body: new Markdown(data: _kMarkdownData)
body: new Markdown(data: _kMarkdownData) )
)
}
)); ));
} }