This repository was archived by the owner on Feb 22, 2018. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change 80
80
* EditRecipe(RouteProvider routeProvider) {
81
81
* RouteHandle route = routeProvider.route.newHandle();
82
82
* _loadRecipe(route);
83
- * route.onLeave .listen((RouteEvent event) {
83
+ * route.onPreLeave .listen((RouteEvent event) {
84
84
* event.allowLeave(_checkIfOkToLeave());
85
85
* });
86
86
* }
87
87
*
88
88
* /// Check if the editor has unsaved contents and if necessary ask
89
89
* /// the user if OK to leave this page.
90
- * Future<bool> _checkIfOkToLeave() { /* ... */ }
90
+ * Future<bool> _checkIfOkToLeave() => /* ... */ ;
91
91
*
92
92
* detach () {
93
93
* route.discard ();
94
94
* }
95
95
* }
96
96
*
97
- * [Route .onLeave ] event is triggered when the browser is routed from an
97
+ * [Route .onPreLeave ] event is triggered when the browser is routed from an
98
98
* active route to a different route. The active route can delay and
99
99
* potentially veto the navigation by passing a [Future <bool >] to
100
- * [RouteEvent .allowLeave].
100
+ * [RoutePreLeaveEvent .allowLeave].
101
101
*
102
102
* Notice that we create a [RouteHandle ] for our route. [RouteHandle ] are
103
103
* a convenient wrapper around [Route ] that makes unsubscribing route events
104
104
* easier. For example, notice that we didn't need to manually call
105
- * [StreamSubscription.cancel] for subscription to [Route.onLeave ]. Calling
105
+ * [StreamSubscription.cancel] for subscription to [Route.onPreLeave ]. Calling
106
106
* [RouteHandle.discard] unsubscribes all listeners created for the handle.
107
107
*
108
108
* ## Hierarchical Routes
Original file line number Diff line number Diff line change @@ -177,7 +177,7 @@ class NgView implements DetachAware, RouteProvider {
177
177
* route.onEnter.listen ((RouteEvent e) {
178
178
* // Do something when the route is activated.
179
179
* });
180
- * route.onLeave .listen ((RouteEvent e) {
180
+ * route.onPreLeave .listen ((RouteEvent e) {
181
181
* // Do something when the route is de-activated.
182
182
* e.allowLeave (allDataSaved ());
183
183
* });
@@ -193,7 +193,7 @@ class NgView implements DetachAware, RouteProvider {
193
193
* }
194
194
* }
195
195
*
196
- * If user component is used outside of ng- view directive then
196
+ * If user component is used outside of ` ng- view` directive then
197
197
* injected [RouteProvider ] will be null .
198
198
*/
199
199
abstract class RouteProvider {
You can’t perform that action at this time.
0 commit comments