Skip to content
This repository was archived by the owner on Feb 22, 2018. It is now read-only.

Commit 80a4c80

Browse files
committed
make a default view route
1 parent 71ba685 commit 80a4c80

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Chapter_05/recipe_book_router.dart

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ class RecipeBookRouteInitializer implements RouteInitializer {
1919
..addRoute(
2020
name: 'edit',
2121
path: '/edit',
22-
enter: view('edit.html')));
22+
enter: view('edit.html'))
23+
..addRoute(name: 'view_default', defaultRoute: true,
24+
enter: (_) =>
25+
router.go('view', {'recipeId': ':recipeId'},
26+
startingFrom: route, replace:true)));
2327
}
24-
}
28+
}
29+
// TODO add a default route and a redirect example

0 commit comments

Comments
 (0)