mirror of
https://github.com/flutter/packages.git
synced 2025-07-01 15:23:25 +08:00
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:
@ -21,7 +21,7 @@ You can use [hyperlinks](hyperlink) in markdown
|
||||
## Code blocks
|
||||
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!
|
||||
""";
|
||||
@ -29,11 +29,9 @@ Enjoy!
|
||||
void main() {
|
||||
runApp(new MaterialApp(
|
||||
title: "Markdown Demo",
|
||||
routes: <String, WidgetBuilder>{
|
||||
'/': (BuildContext context) => new Scaffold(
|
||||
appBar: new AppBar(title: new Text("Markdown Demo")),
|
||||
body: new Markdown(data: _kMarkdownData)
|
||||
)
|
||||
}
|
||||
home: new Scaffold(
|
||||
appBar: new AppBar(title: new Text('Markdown Demo')),
|
||||
body: new Markdown(data: _kMarkdownData)
|
||||
)
|
||||
));
|
||||
}
|
||||
|
Reference in New Issue
Block a user